<!doctype html>
<html lang="ru" data-bs-theme="dark">

<head>
    <!-- 2024-05-11 14:17:38 -->
        <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <title>Git - gitcli</title>
        <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.3/css/bootstrap.min.css" integrity="sha512-jnSuA4Ss2PkkikSOLtYs8BlYIeeIK1h99ty4YfvRPAlzr377vr3CXDb7sb7eEEBYjDtcYj+AjBH3FLv5uSJuXg==" crossorigin="anonymous" referrerpolicy="no-referrer" />
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bootstrap-icons/1.11.3/font/bootstrap-icons.min.css" integrity="sha512-dPXYcDub/aeb08c63jRq/k6GaKccl256JQy/AnOq7CAnEZ9FzSL9wSbcZkMp4R26vBsMLFYH4kQ67/bbV8XaCQ==" crossorigin="anonymous" referrerpolicy="no-referrer" />
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github-dark.min.css" integrity="sha512-rO+olRTkcf304DQBxSWxln8JXCzTHlKnIdnMUwYvQa9/Jd4cQaNkItIUj6Z4nvW1dqK0SKXLbn9h4KwZTNtAyw==" crossorigin="anonymous" referrerpolicy="no-referrer" />
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/flag-icon-css/7.1.0/css/flag-icons.min.css" integrity="sha512-bZBu2H0+FGFz/stDN/L0k8J0G8qVsAL0ht1qg5kTwtAheiXwiRKyCq1frwfbSFSJN3jooR5kauE0YjtPzhZtJQ==" crossorigin="anonymous" referrerpolicy="no-referrer" />
    <link href="../../../runebook.css" rel="stylesheet" type="text/css">
    <meta name="x-github" content="https://github.com/runebookdev/runebook">
            <meta name="x-i18n-doc" content="git">
        <script>
        function i18n(element) {
            // NOP
        }
    </script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/js-cookie/3.0.5/js.cookie.js" integrity="sha512-F/dia2jKME12jwqiYDayeD+Rr/8jTWUD2wfbuJB0bzSwenSEnXsn4qQ/wVyXUCix5bmCAj8xJdtFr2OqUtjLAw==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js" integrity="sha512-v2CJ7UaYy4JwqLDIrZUI/4hqeoQieOmAZNXBeQyjo21dadnwR+8ZaIJVT8EE2iyI61OV8e6M8PP2/4hpQINQ/g==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/bootstrap/5.3.3/js/bootstrap.bundle.min.js" integrity="sha512-7Pi/otdlbbCR+LnW+F7PwFcSDJOuUJB3OxtEHbg4vSMvzvJjde4Po1v4BR9Gdc9aXNUNFVUY+SK51wWT8WF0Gg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/rxjs/7.8.1/rxjs.umd.min.js" integrity="sha512-D9LDs8YUUVa4V9Gl4Zb+xqRAc7RCzooR3+zzebgK2RMu/KU+dh90pbjEEMzPiSyRSGbSp9j1pZnrO4joGa5WEg==" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.1/jquery.mark.min.js" integrity="sha512-mhbv5DqBMgrWL+32MmsDOt/OAvqr/cHimk6B8y/bx/xS88MVkYGPiVv2ixKVrkywF2qHplNRUvFsAHUdxZ3Krg==" crossorigin="anonymous"></script>
    <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-6424571640879890" crossorigin="anonymous"></script>    <script async src="https://www.googletagmanager.com/gtag/js?id=G-3G5BZ1QEDP"></script>
<script>
    window.dataLayer = window.dataLayer || [];

    function gtag() {
        dataLayer.push(arguments);
    }

    gtag('js', new Date());
    gtag('config', 'G-3G5BZ1QEDP');
</script>    <script>
(function(c, l, a, r, i, t, y) {
    c[a] = c[a] || function() {
        (c[a].q = c[a].q || []).push(arguments)
    };
    t = l.createElement(r);
    t.async = 1;
    t.src = "https://www.clarity.ms/tag/" + i + "?ref=bwt";
    y = l.getElementsByTagName(r)[0];
    y.parentNode.insertBefore(t, y);
})(window, document, "clarity", "script", "jto2hd94r9");
</script>    <script src="../../../theme.js"></script>
</head>

<body>
    <header class="bg-black">
        <div class="container">
            <div class="row">
                <div class="col">
                    <nav class="navbar navbar-expand-lg navbar-dark">
                        <a class="navbar-brand fw-bold" href="https://runebook.dev/ru">
                            <img alt="Runebook.dev" class="d-inline-block align-top mr-1" src="../../../assets/runebook_logo.webp" width="24" height="24">
                            Runebook.dev
                        </a>
                        <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
                            <span class="navbar-toggler-icon"></span>
                        </button>
                        <div class="collapse navbar-collapse" id="navbarSupportedContent">
                            <ul class="navbar-nav me-auto mb-2 mb-lg-0">
                                <li class="nav-item">
                                    <a class="nav-link" href="https://runebook.dev/ru#docs">Documentation</a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link" href="https://runebook.dev/contributors">Contributors</a>
                                </li>
                                <li class="nav-item">
                                    <a class="nav-link" href="https://github.com/runebookdev/runebook/issues">GitHub</a>
                                </li>
                            </ul>
                                                                                                <button class="btn btn-success ms-2" id="showPopupButton">
                                        <i class="bi bi-translate"></i>
                                        Show English
                                    </button>
                                                                                        <div class="form-check form-switch ms-3">
                                <label class="text-light">
                                    <input class="form-check-input" type="checkbox" role="switch" id="theme-switch" checked>
                                    <i class="bi bi-moon-stars-fill"></i>
                                </label>
                            </div>
                        </div>
                    </nav>
                </div>
            </div>
        </div>
    </header>

    <!--sse-->
    <div class="container">
    <div class="row">
        <div class="col">
            <nav aria-label="breadcrumb" class="mt-2">
                <ol class="breadcrumb mb-1">
                    <li class="breadcrumb-item">
                        <a href="https://runebook.dev/ru#docs">
                            <span class="fi fi-ru"></span>                            Русский                        </a>
                    </li>
                    <li class="breadcrumb-item">
                        <a href="-index-.html">
                            Git                            2.43                        </a>
                    </li>
                                            <li class="breadcrumb-item">
                            <a href="-index-.html#Guides">
                                Guides                            </a>
                        </li>
                                    </ol>
            </nav>
        </div>
    </div>
    <br>

    <div class="row">
        <div class="col-md-9">
            <main>
                <article>

                    
                    <h1 class="text-body-emphasis" ><span data-i18n="c12f652d149e3b364b9332109b1a7dafcf8cf94ddc041e8ee764a8e3b1497cb3/db" data-source="gitcli" onmousemove="i18n(this)">gitcli</span></h1> <h2 class="text-body-emphasis"  id="_name"><span data-i18n="dcd1d5223f73b3a965c07e3ff5dbee3eedcfedb806686a05b9b3868a2c3d6d50/3a" data-source="Name" onmousemove="i18n(this)">Name</span></h2> <div> <p><span data-i18n="b9e54d64a8ab26c071a485cf8d75fe711ef8a98c81b0cd24170c79f296dd46a7/a1" data-source="gitcli - Git command-line interface and conventions" onmousemove="i18n(this)">gitcli &mdash;  Git  &icy;&ncy;&tcy;&iecy;&rcy;&fcy;&iecy;&jcy;&scy; &kcy;&ocy;&mcy;&acy;&ncy;&dcy;&ncy;&ocy;&jcy; &scy;&tcy;&rcy;&ocy;&kcy;&icy; &icy; &scy;&ocy;&gcy;&lcy;&acy;&shcy;&iecy;&ncy;&icy;&yacy;</span></p> </div> <h2 class="text-body-emphasis"  id="_synopsis"><span data-i18n="8eb3755381519d7f0479d75446e56e20084834c0460d7ec94926932372ea6c47/0d" data-source="Synopsis" onmousemove="i18n(this)">Synopsis</span></h2> <div> <p><span data-i18n="c12f652d149e3b364b9332109b1a7dafcf8cf94ddc041e8ee764a8e3b1497cb3/db" data-source="gitcli" onmousemove="i18n(this)">gitcli</span></p> </div> <h2 class="text-body-emphasis"  id="_description"><span data-i18n="526e0087cc3f254d9f86f6c7d8e23d954c4dfda2b312efc29194ae8a860106ba/d3" data-source="Description" onmousemove="i18n(this)">Description</span></h2> <div> <p><span data-i18n="81ce561c1fca282669c1a21d7d636a7ff57e5ed542e7bb18b10f4de469dc5235/a8" data-source="This manual describes the convention used throughout Git CLI." onmousemove="i18n(this)">&Vcy; &ecy;&tcy;&ocy;&mcy; &rcy;&ucy;&kcy;&ocy;&vcy;&ocy;&dcy;&scy;&tcy;&vcy;&iecy; &ocy;&pcy;&icy;&scy;&ycy;&vcy;&acy;&yucy;&tcy;&scy;&yacy; &scy;&ocy;&gcy;&lcy;&acy;&shcy;&iecy;&ncy;&icy;&yacy;, &icy;&scy;&pcy;&ocy;&lcy;&softcy;&zcy;&ucy;&iecy;&mcy;&ycy;&iecy; &vcy; &icy;&ncy;&tcy;&iecy;&rcy;&fcy;&iecy;&jcy;&scy;&iecy; &kcy;&ocy;&mcy;&acy;&ncy;&dcy;&ncy;&ocy;&jcy; &scy;&tcy;&rcy;&ocy;&kcy;&icy;  Git .</span></p> <p><span data-i18n="7d022f118654a7318d9190ffcda2875789b4ee2a9c09d4e0fcc7664d97738a55/85" data-source="Many commands take revisions (most often &amp;quot;commits&amp;quot;, but sometimes &amp;quot;tree-ish&amp;quot;, depending on the context and command) and paths as their arguments. Here are the rules:" onmousemove="i18n(this)">&Mcy;&ncy;&ocy;&gcy;&icy;&iecy; &kcy;&ocy;&mcy;&acy;&ncy;&dcy;&ycy; &pcy;&rcy;&icy;&ncy;&icy;&mcy;&acy;&yucy;&tcy; &vcy; &kcy;&acy;&chcy;&iecy;&scy;&tcy;&vcy;&iecy; &acy;&rcy;&gcy;&ucy;&mcy;&iecy;&ncy;&tcy;&ocy;&vcy; &vcy;&iecy;&rcy;&scy;&icy;&icy; (&chcy;&acy;&shchcy;&iecy; &vcy;&scy;&iecy;&gcy;&ocy;  &quot;commits&quot; , &ncy;&ocy; &icy;&ncy;&ocy;&gcy;&dcy;&acy;  &quot;tree-ish&quot; , &vcy; &zcy;&acy;&vcy;&icy;&scy;&icy;&mcy;&ocy;&scy;&tcy;&icy; &ocy;&tcy; &kcy;&ocy;&ncy;&tcy;&iecy;&kcy;&scy;&tcy;&acy; &icy; &kcy;&ocy;&mcy;&acy;&ncy;&dcy;&ycy;) &icy; &pcy;&ucy;&tcy;&icy;. &Vcy;&ocy;&tcy; &pcy;&rcy;&acy;&vcy;&icy;&lcy;&acy;:</span></p> <div> <ul> <li> <p><span data-i18n="897af340908b7725de760eea8fccb26ff869e74505b661cfa7f29d81e7d870df/d3" data-source="Options come first and then args. A subcommand may take dashed options (which may take their own arguments, e.g. &amp;quot;--max-parents 2&amp;quot;) and arguments. You SHOULD give dashed options first and then arguments. Some commands may accept dashed options after you have already given non-option arguments (which may make the command ambiguous), but you should not rely on it (because eventually we may find a way to fix these ambiguities by enforcing the &amp;quot;options then args&amp;quot; rule)." onmousemove="i18n(this)">&Scy;&ncy;&acy;&chcy;&acy;&lcy;&acy; &icy;&dcy;&ucy;&tcy; &ocy;&pcy;&tscy;&icy;&icy;, &acy; &zcy;&acy;&tcy;&iecy;&mcy; &acy;&rcy;&gcy;&ucy;&mcy;&iecy;&ncy;&tcy;&ycy;. &Pcy;&ocy;&dcy;&kcy;&ocy;&mcy;&acy;&ncy;&dcy;&acy; &mcy;&ocy;&zhcy;&iecy;&tcy; &pcy;&rcy;&icy;&ncy;&icy;&mcy;&acy;&tcy;&softcy; &pcy;&ucy;&ncy;&kcy;&tcy;&icy;&rcy;&ncy;&ycy;&iecy; &pcy;&acy;&rcy;&acy;&mcy;&iecy;&tcy;&rcy;&ycy; (&kcy;&ocy;&tcy;&ocy;&rcy;&ycy;&iecy; &mcy;&ocy;&gcy;&ucy;&tcy; &icy;&mcy;&iecy;&tcy;&softcy; &scy;&ocy;&bcy;&scy;&tcy;&vcy;&iecy;&ncy;&ncy;&ycy;&iecy; &acy;&rcy;&gcy;&ucy;&mcy;&iecy;&ncy;&tcy;&ycy;, &ncy;&acy;&pcy;&rcy;&icy;&mcy;&iecy;&rcy;  &quot;--max-parents 2&quot; ) &icy; &acy;&rcy;&gcy;&ucy;&mcy;&iecy;&ncy;&tcy;&ycy;. &Vcy;&ycy; &Dcy;&Ocy;&Lcy;&ZHcy;&Ncy;&Ycy; &scy;&ncy;&acy;&chcy;&acy;&lcy;&acy; &ucy;&kcy;&acy;&zcy;&acy;&tcy;&softcy; &pcy;&ucy;&ncy;&kcy;&tcy;&icy;&rcy;&ncy;&ycy;&iecy; &vcy;&acy;&rcy;&icy;&acy;&ncy;&tcy;&ycy;, &acy; &zcy;&acy;&tcy;&iecy;&mcy; &acy;&rcy;&gcy;&ucy;&mcy;&iecy;&ncy;&tcy;&ycy;. &Ncy;&iecy;&kcy;&ocy;&tcy;&ocy;&rcy;&ycy;&iecy; &kcy;&ocy;&mcy;&acy;&ncy;&dcy;&ycy; &mcy;&ocy;&gcy;&ucy;&tcy; &pcy;&rcy;&icy;&ncy;&icy;&mcy;&acy;&tcy;&softcy; &pcy;&ucy;&ncy;&kcy;&tcy;&icy;&rcy;&ncy;&ycy;&iecy; &pcy;&acy;&rcy;&acy;&mcy;&iecy;&tcy;&rcy;&ycy; &pcy;&ocy;&scy;&lcy;&iecy; &tcy;&ocy;&gcy;&ocy;, &kcy;&acy;&kcy; &vcy;&ycy; &ucy;&zhcy;&iecy; &ucy;&kcy;&acy;&zcy;&acy;&lcy;&icy; &acy;&rcy;&gcy;&ucy;&mcy;&iecy;&ncy;&tcy;&ycy;, &ncy;&iecy; &yacy;&vcy;&lcy;&yacy;&yucy;&shchcy;&icy;&iecy;&scy;&yacy; &pcy;&acy;&rcy;&acy;&mcy;&iecy;&tcy;&rcy;&acy;&mcy;&icy; (&chcy;&tcy;&ocy; &mcy;&ocy;&zhcy;&iecy;&tcy; &scy;&dcy;&iecy;&lcy;&acy;&tcy;&softcy; &kcy;&ocy;&mcy;&acy;&ncy;&dcy;&ucy; &ncy;&iecy;&ocy;&dcy;&ncy;&ocy;&zcy;&ncy;&acy;&chcy;&ncy;&ocy;&jcy;), &ncy;&ocy; &vcy;&acy;&mcy; &ncy;&iecy; &scy;&lcy;&iecy;&dcy;&ucy;&iecy;&tcy; &pcy;&ocy;&lcy;&acy;&gcy;&acy;&tcy;&softcy;&scy;&yacy; &ncy;&acy; &ncy;&icy;&khcy; (&pcy;&ocy;&tcy;&ocy;&mcy;&ucy; &chcy;&tcy;&ocy; &vcy; &kcy;&ocy;&ncy;&iecy;&chcy;&ncy;&ocy;&mcy; &icy;&tcy;&ocy;&gcy;&iecy; &mcy;&ycy; &mcy;&ocy;&zhcy;&iecy;&mcy; &ncy;&acy;&jcy;&tcy;&icy; &scy;&pcy;&ocy;&scy;&ocy;&bcy; &icy;&scy;&pcy;&rcy;&acy;&vcy;&icy;&tcy;&softcy; &ecy;&tcy;&ucy; &ncy;&iecy;&ocy;&dcy;&ncy;&ocy;&zcy;&ncy;&acy;&chcy;&ncy;&ocy;&scy;&tcy;&softcy;, &pcy;&rcy;&icy;&mcy;&iecy;&ncy;&yacy;&yacy; &pcy;&rcy;&acy;&vcy;&icy;&lcy;&ocy;  &quot;options then args&quot; ).</span></p> </li> <li> <p><span data-i18n="bee883d6a7e074856bb1e8c0876902891482a983c47b0a73624f31240f601d35/63" data-source="Revisions come first and then paths. E.g. in &lt;code&gt;git diff v1.0 v2.0 arch/x86 include/asm-x86&lt;/code&gt;, &lt;code&gt;v1.0&lt;/code&gt; and &lt;code&gt;v2.0&lt;/code&gt; are revisions and &lt;code&gt;arch/x86&lt;/code&gt; and &lt;code&gt;include/asm-x86&lt;/code&gt; are paths." onmousemove="i18n(this)">&Scy;&ncy;&acy;&chcy;&acy;&lcy;&acy; &icy;&dcy;&ucy;&tcy; &icy;&zcy;&mcy;&iecy;&ncy;&iecy;&ncy;&icy;&yacy;, &acy; &zcy;&acy;&tcy;&iecy;&mcy; &pcy;&ucy;&tcy;&icy;. &Ncy;&acy;&pcy;&rcy;&icy;&mcy;&iecy;&rcy;, &vcy;  <code>git diff v1.0 v2.0 arch/x86 include/asm-x86</code> <code>v1.0</code>  &icy;  <code>v2.0</code>  &mdash; &ecy;&tcy;&ocy; &vcy;&iecy;&rcy;&scy;&icy;&icy;, &acy;  <code>arch/x86</code>  &icy;  <code>include/asm-x86</code>  &mdash; &ecy;&tcy;&ocy; &pcy;&ucy;&tcy;&icy;.</span></p> </li> <li> <p><span data-i18n="920d6ee43ef66b5f2f0d5a2cd3406c11dae2d1758d0b3deade5d62064f7a4763/73" data-source="When an argument can be misunderstood as either a revision or a path, they can be disambiguated by placing &lt;code&gt;--&lt;/code&gt; between them. E.g. &lt;code&gt;git diff -- HEAD&lt;/code&gt; is, &amp;quot;I have a file called HEAD in my work tree. Please show changes between the version I staged in the index and what I have in the work tree for that file&amp;quot;, not &amp;quot;show the difference between the HEAD commit and the work tree as a whole&amp;quot;. You can say &lt;code&gt;git diff HEAD --&lt;/code&gt; to ask for the latter." onmousemove="i18n(this)">&IEcy;&scy;&lcy;&icy; &acy;&rcy;&gcy;&ucy;&mcy;&iecy;&ncy;&tcy; &mcy;&ocy;&zhcy;&iecy;&tcy; &bcy;&ycy;&tcy;&softcy; &ocy;&shcy;&icy;&bcy;&ocy;&chcy;&ncy;&ocy; &vcy;&ocy;&scy;&pcy;&rcy;&icy;&ncy;&yacy;&tcy; &kcy;&acy;&kcy; &rcy;&iecy;&vcy;&icy;&zcy;&icy;&yacy; &icy;&lcy;&icy; &pcy;&ucy;&tcy;&softcy;, &icy;&khcy; &mcy;&ocy;&zhcy;&ncy;&ocy; &ucy;&scy;&tcy;&rcy;&acy;&ncy;&icy;&tcy;&softcy;, &pcy;&ocy;&mcy;&iecy;&scy;&tcy;&icy;&vcy; &mcy;&iecy;&zhcy;&dcy;&ucy; &ncy;&icy;&mcy;&icy;  <code>--</code> . &Ncy;&acy;&pcy;&rcy;&icy;&mcy;&iecy;&rcy;,  <code>git diff -- HEAD</code>  &mdash; &ecy;&tcy;&ocy;  &quot;I have a file called HEAD in my work tree. Please show changes between the version I staged in the index and what I have in the work tree for that file&quot; , &acy; &ncy;&iecy;  &quot;show the difference between the HEAD commit and the work tree as a whole&quot; . &Vcy;&ycy; &mcy;&ocy;&zhcy;&iecy;&tcy;&iecy; &scy;&kcy;&acy;&zcy;&acy;&tcy;&softcy;  <code>git diff HEAD --</code> , &chcy;&tcy;&ocy;&bcy;&ycy; &pcy;&ocy;&pcy;&rcy;&ocy;&scy;&icy;&tcy;&softcy; &pcy;&ocy;&scy;&lcy;&iecy;&dcy;&ncy;&iecy;&iecy;.</span></p> </li> <li> <p><span data-i18n="4667ba066ef48c0e1fe9ebb95f50ca60b97da71c494b6a0c957a32e8b14835f4/5b" data-source="Without disambiguating &lt;code&gt;--&lt;/code&gt;, Git makes a reasonable guess, but errors out and asks you to disambiguate when ambiguous. E.g. if you have a file called HEAD in your work tree, &lt;code&gt;git diff HEAD&lt;/code&gt; is ambiguous, and you have to say either &lt;code&gt;git diff HEAD --&lt;/code&gt; or &lt;code&gt;git diff -- HEAD&lt;/code&gt; to disambiguate." onmousemove="i18n(this)">&Ncy;&iecy; &ucy;&scy;&tcy;&rcy;&acy;&ncy;&yacy;&yacy; &ncy;&iecy;&ocy;&dcy;&ncy;&ocy;&zcy;&ncy;&acy;&chcy;&ncy;&ocy;&scy;&tcy;&softcy;  <code>--</code>  ,  Git  &dcy;&iecy;&lcy;&acy;&iecy;&tcy; &rcy;&acy;&zcy;&ucy;&mcy;&ncy;&ocy;&iecy; &pcy;&rcy;&iecy;&dcy;&pcy;&ocy;&lcy;&ocy;&zhcy;&iecy;&ncy;&icy;&iecy;, &ncy;&ocy; &vcy;&ycy;&dcy;&acy;&iecy;&tcy; &ocy;&shcy;&icy;&bcy;&kcy;&ucy; &icy; &pcy;&rcy;&ocy;&scy;&icy;&tcy; &vcy;&acy;&scy; &ucy;&scy;&tcy;&rcy;&acy;&ncy;&icy;&tcy;&softcy; &ncy;&iecy;&ocy;&dcy;&ncy;&ocy;&zcy;&ncy;&acy;&chcy;&ncy;&ocy;&scy;&tcy;&softcy;, &iecy;&scy;&lcy;&icy; &ocy;&ncy;&acy; &ncy;&iecy;&ocy;&dcy;&ncy;&ocy;&zcy;&ncy;&acy;&chcy;&ncy;&acy;. &Ncy;&acy;&pcy;&rcy;&icy;&mcy;&iecy;&rcy;, &iecy;&scy;&lcy;&icy; &vcy; &vcy;&acy;&shcy;&iecy;&mcy; &rcy;&acy;&bcy;&ocy;&chcy;&iecy;&mcy; &dcy;&iecy;&rcy;&iecy;&vcy;&iecy; &iecy;&scy;&tcy;&softcy; &fcy;&acy;&jcy;&lcy; &scy; &icy;&mcy;&iecy;&ncy;&iecy;&mcy; HEAD,  <code>git diff HEAD</code>  &ncy;&iecy;&ocy;&dcy;&ncy;&ocy;&zcy;&ncy;&acy;&chcy;&iecy;&ncy;, &icy; &vcy;&acy;&mcy; &ncy;&ucy;&zhcy;&ncy;&ocy; &scy;&kcy;&acy;&zcy;&acy;&tcy;&softcy; &lcy;&icy;&bcy;&ocy;  <code>git diff HEAD --</code> , &lcy;&icy;&bcy;&ocy;  <code>git diff -- HEAD</code> , &chcy;&tcy;&ocy;&bcy;&ycy; &ucy;&scy;&tcy;&rcy;&acy;&ncy;&icy;&tcy;&softcy; &ncy;&iecy;&ocy;&dcy;&ncy;&ocy;&zcy;&ncy;&acy;&chcy;&ncy;&ocy;&scy;&tcy;&softcy;.</span></p> </li> <li> <p><span data-i18n="4a633ac98e87c4f352c2a8f77f4d78587cc33866cf5f0dd3f1ae2ab8be85e49c/4e" data-source="Because &lt;code&gt;--&lt;/code&gt; disambiguates revisions and paths in some commands, it cannot be used for those commands to separate options and revisions. You can use &lt;code&gt;--end-of-options&lt;/code&gt; for this (it also works for commands that do not distinguish between revisions in paths, in which case it is simply an alias for &lt;code&gt;--&lt;/code&gt;)." onmousemove="i18n(this)">&Pcy;&ocy;&scy;&kcy;&ocy;&lcy;&softcy;&kcy;&ucy;  <code>--</code>  &ucy;&scy;&tcy;&rcy;&acy;&ncy;&yacy;&iecy;&tcy; &ncy;&iecy;&ocy;&dcy;&ncy;&ocy;&zcy;&ncy;&acy;&chcy;&ncy;&ocy;&scy;&tcy;&softcy; &vcy;&iecy;&rcy;&scy;&icy;&jcy; &icy; &pcy;&ucy;&tcy;&iecy;&jcy; &vcy; &ncy;&iecy;&kcy;&ocy;&tcy;&ocy;&rcy;&ycy;&khcy; &kcy;&ocy;&mcy;&acy;&ncy;&dcy;&acy;&khcy;, &iecy;&gcy;&ocy; &ncy;&iecy;&lcy;&softcy;&zcy;&yacy; &icy;&scy;&pcy;&ocy;&lcy;&softcy;&zcy;&ocy;&vcy;&acy;&tcy;&softcy; &dcy;&lcy;&yacy; &ecy;&tcy;&icy;&khcy; &kcy;&ocy;&mcy;&acy;&ncy;&dcy; &dcy;&lcy;&yacy; &rcy;&acy;&zcy;&dcy;&iecy;&lcy;&iecy;&ncy;&icy;&yacy; &pcy;&acy;&rcy;&acy;&mcy;&iecy;&tcy;&rcy;&ocy;&vcy; &icy; &vcy;&iecy;&rcy;&scy;&icy;&jcy;. &Dcy;&lcy;&yacy; &ecy;&tcy;&ocy;&gcy;&ocy; &mcy;&ocy;&zhcy;&ncy;&ocy; &icy;&scy;&pcy;&ocy;&lcy;&softcy;&zcy;&ocy;&vcy;&acy;&tcy;&softcy;  <code>--end-of-options</code>  (&ocy;&ncy; &tcy;&acy;&kcy;&zhcy;&iecy; &rcy;&acy;&bcy;&ocy;&tcy;&acy;&iecy;&tcy; &dcy;&lcy;&yacy; &kcy;&ocy;&mcy;&acy;&ncy;&dcy;, &kcy;&ocy;&tcy;&ocy;&rcy;&ycy;&iecy; &ncy;&iecy; &rcy;&acy;&zcy;&lcy;&icy;&chcy;&acy;&yucy;&tcy; &rcy;&iecy;&vcy;&icy;&zcy;&icy;&icy; &vcy; &pcy;&ucy;&tcy;&yacy;&khcy;, &icy; &vcy; &ecy;&tcy;&ocy;&mcy; &scy;&lcy;&ucy;&chcy;&acy;&iecy; &ecy;&tcy;&ocy; &pcy;&rcy;&ocy;&scy;&tcy;&ocy; &pcy;&scy;&iecy;&vcy;&dcy;&ocy;&ncy;&icy;&mcy; &dcy;&lcy;&yacy;  <code>--</code> ).</span></p> <p><span data-i18n="f1c5ec06accad6dd2994455f79c132a00f0513c56f8578c61b5a2649eadd1018/08" data-source="When writing a script that is expected to handle random user-input, it is a good practice to make it explicit which arguments are which by placing disambiguating &lt;code&gt;--&lt;/code&gt; at appropriate places." onmousemove="i18n(this)">&Pcy;&rcy;&icy; &ncy;&acy;&pcy;&icy;&scy;&acy;&ncy;&icy;&icy; &scy;&tscy;&iecy;&ncy;&acy;&rcy;&icy;&yacy;, &kcy;&ocy;&tcy;&ocy;&rcy;&ycy;&jcy;, &kcy;&acy;&kcy; &ocy;&zhcy;&icy;&dcy;&acy;&iecy;&tcy;&scy;&yacy;, &bcy;&ucy;&dcy;&iecy;&tcy; &ocy;&bcy;&rcy;&acy;&bcy;&acy;&tcy;&ycy;&vcy;&acy;&tcy;&softcy; &scy;&lcy;&ucy;&chcy;&acy;&jcy;&ncy;&ycy;&jcy; &pcy;&ocy;&lcy;&softcy;&zcy;&ocy;&vcy;&acy;&tcy;&iecy;&lcy;&softcy;&scy;&kcy;&icy;&jcy; &vcy;&vcy;&ocy;&dcy;, &rcy;&iecy;&kcy;&ocy;&mcy;&iecy;&ncy;&dcy;&ucy;&iecy;&tcy;&scy;&yacy; &chcy;&iecy;&tcy;&kcy;&ocy; &ucy;&kcy;&acy;&zcy;&ycy;&vcy;&acy;&tcy;&softcy;, &kcy;&acy;&kcy;&icy;&iecy; &acy;&rcy;&gcy;&ucy;&mcy;&iecy;&ncy;&tcy;&ycy; &yacy;&vcy;&lcy;&yacy;&yucy;&tcy;&scy;&yacy; &kcy;&acy;&kcy;&icy;&mcy;&icy;, &pcy;&ocy;&mcy;&iecy;&shchcy;&acy;&yacy; &ucy;&scy;&tcy;&rcy;&acy;&ncy;&yacy;&yucy;&shchcy;&ucy;&yucy; &ncy;&iecy;&ocy;&dcy;&ncy;&ocy;&zcy;&ncy;&acy;&chcy;&ncy;&ocy;&scy;&tcy;&softcy;  <code>--</code>  &vcy; &scy;&ocy;&ocy;&tcy;&vcy;&iecy;&tcy;&scy;&tcy;&vcy;&ucy;&yucy;&shchcy;&icy;&khcy; &mcy;&iecy;&scy;&tcy;&acy;&khcy;.</span></p> </li> <li> <p><span data-i18n="fdd6ae1c75275b3941a4a7a2ada3fe1c5705a6bd7182530eb71ec4bd8a414f4a/ea" data-source="Many commands allow wildcards in paths, but you need to protect them from getting globbed by the shell. These two mean different things:" onmousemove="i18n(this)">&Mcy;&ncy;&ocy;&gcy;&icy;&iecy; &kcy;&ocy;&mcy;&acy;&ncy;&dcy;&ycy; &dcy;&ocy;&pcy;&ucy;&scy;&kcy;&acy;&yucy;&tcy; &icy;&scy;&pcy;&ocy;&lcy;&softcy;&zcy;&ocy;&vcy;&acy;&ncy;&icy;&iecy; &pcy;&ocy;&dcy;&scy;&tcy;&acy;&ncy;&ocy;&vcy;&ocy;&chcy;&ncy;&ycy;&khcy; &zcy;&ncy;&acy;&kcy;&ocy;&vcy; &vcy; &pcy;&ucy;&tcy;&yacy;&khcy;, &ncy;&ocy; &vcy;&acy;&mcy; &ncy;&iecy;&ocy;&bcy;&khcy;&ocy;&dcy;&icy;&mcy;&ocy; &zcy;&acy;&shchcy;&icy;&tcy;&icy;&tcy;&softcy; &icy;&khcy; &ocy;&tcy; &pcy;&ocy;&dcy;&scy;&tcy;&acy;&ncy;&ocy;&vcy;&kcy;&icy; &ocy;&bcy;&ocy;&lcy;&ocy;&chcy;&kcy;&ocy;&jcy;. &Ecy;&tcy;&icy; &dcy;&vcy;&acy; &ocy;&zcy;&ncy;&acy;&chcy;&acy;&yucy;&tcy; &rcy;&acy;&zcy;&ncy;&ycy;&iecy; &vcy;&iecy;&shchcy;&icy;:</span></p> <div> <div> <pre class="hljs language-ruby"><span class="hljs-variable">$ </span>git restore *.c
<span class="hljs-variable">$ </span>git restore \*.c</pre> </div> </div> <p><span data-i18n="7574ba7d3896e7706a64af420d7f4feea694347e1a4bb6e2809710a39e6c7d7c/93" data-source="The former lets your shell expand the fileglob, and you are asking the dot-C files in your working tree to be overwritten with the version in the index. The latter passes the &lt;code&gt;*.c&lt;/code&gt; to Git, and you are asking the paths in the index that match the pattern to be checked out to your working tree. After running &lt;code&gt;git add hello.c; rm hello.c&lt;/code&gt;, you will &lt;code&gt;not&lt;/code&gt; see &lt;code&gt;hello.c&lt;/code&gt; in your working tree with the former, but with the latter you will." onmousemove="i18n(this)">&Pcy;&iecy;&rcy;&vcy;&ycy;&jcy; &pcy;&ocy;&zcy;&vcy;&ocy;&lcy;&yacy;&iecy;&tcy; &vcy;&acy;&shcy;&iecy;&jcy; &ocy;&bcy;&ocy;&lcy;&ocy;&chcy;&kcy;&iecy; &rcy;&acy;&scy;&shcy;&icy;&rcy;&icy;&tcy;&softcy; &fcy;&acy;&jcy;&lcy;&ocy;&vcy;&ycy;&jcy; &mcy;&acy;&scy;&scy;&icy;&vcy;, &icy; &vcy;&ycy; &zcy;&acy;&pcy;&rcy;&acy;&shcy;&icy;&vcy;&acy;&iecy;&tcy;&iecy; &pcy;&iecy;&rcy;&iecy;&zcy;&acy;&pcy;&icy;&scy;&softcy; &fcy;&acy;&jcy;&lcy;&ocy;&vcy; dot-C &vcy; &vcy;&acy;&shcy;&iecy;&mcy; &rcy;&acy;&bcy;&ocy;&chcy;&iecy;&mcy; &dcy;&iecy;&rcy;&iecy;&vcy;&iecy; &vcy;&iecy;&rcy;&scy;&icy;&iecy;&jcy; &icy;&zcy; &icy;&ncy;&dcy;&iecy;&kcy;&scy;&acy;. &Pcy;&ocy;&scy;&lcy;&iecy;&dcy;&ncy;&icy;&jcy; &pcy;&iecy;&rcy;&iecy;&dcy;&acy;&iecy;&tcy;  <code>*.c</code>  &vcy; Git, &icy; &vcy;&ycy; &zcy;&acy;&pcy;&rcy;&acy;&shcy;&icy;&vcy;&acy;&iecy;&tcy;&iecy; &pcy;&ucy;&tcy;&icy; &vcy; &icy;&ncy;&dcy;&iecy;&kcy;&scy;&iecy;, &scy;&ocy;&ocy;&tcy;&vcy;&iecy;&tcy;&scy;&tcy;&vcy;&ucy;&yucy;&shchcy;&icy;&iecy; &shcy;&acy;&bcy;&lcy;&ocy;&ncy;&ucy;, &dcy;&lcy;&yacy; &icy;&zcy;&vcy;&lcy;&iecy;&chcy;&iecy;&ncy;&icy;&yacy; &vcy; &vcy;&acy;&shcy;&iecy; &rcy;&acy;&bcy;&ocy;&chcy;&iecy;&iecy; &dcy;&iecy;&rcy;&iecy;&vcy;&ocy;. &Pcy;&ocy;&scy;&lcy;&iecy; &zcy;&acy;&pcy;&ucy;&scy;&kcy;&acy;  <code>git add hello.c; rm hello.c</code>  &vcy;&ycy; &ucy;&vcy;&icy;&dcy;&icy;&tcy;&iecy;  <code>not</code>  &vcy; &rcy;&acy;&bcy;&ocy;&chcy;&iecy;&mcy; &dcy;&iecy;&rcy;&iecy;&vcy;&iecy;  <code>hello.c</code>  &scy; &pcy;&iecy;&rcy;&vcy;&ycy;&mcy;, &ncy;&ocy; &scy;&ocy; &vcy;&tcy;&ocy;&rcy;&ycy;&mcy; &vcy;&ycy; &ucy;&vcy;&icy;&dcy;&icy;&tcy;&iecy;.</span></p> </li> <li> <p><span data-i18n="d23936550283c3a83be473e7c078020c9db7e6f3d8cb0b9ef5f7b947a48f560c/77" data-source="Just as the filesystem &lt;code&gt;.&lt;/code&gt; (period) refers to the current directory, using a &lt;code&gt;.&lt;/code&gt; as a repository name in Git (a dot-repository) is a relative path and means your current repository." onmousemove="i18n(this)">&Tcy;&acy;&kcy; &zhcy;&iecy;, &kcy;&acy;&kcy; &fcy;&acy;&jcy;&lcy;&ocy;&vcy;&acy;&yacy; &scy;&icy;&scy;&tcy;&iecy;&mcy;&acy;  <code>.</code>  (&tcy;&ocy;&chcy;&kcy;&acy;) &ocy;&tcy;&ncy;&ocy;&scy;&icy;&tcy;&scy;&yacy; &kcy; &tcy;&iecy;&kcy;&ucy;&shchcy;&iecy;&mcy;&ucy; &kcy;&acy;&tcy;&acy;&lcy;&ocy;&gcy;&ucy;, &icy;&scy;&pcy;&ocy;&lcy;&softcy;&zcy;&ocy;&vcy;&acy;&ncy;&icy;&iecy;  <code>.</code>  &vcy; &kcy;&acy;&chcy;&iecy;&scy;&tcy;&vcy;&iecy; &icy;&mcy;&iecy;&ncy;&icy; &rcy;&iecy;&pcy;&ocy;&zcy;&icy;&tcy;&ocy;&rcy;&icy;&yacy; &vcy;  Git  (&tcy;&ocy;&chcy;&iecy;&chcy;&ncy;&ycy;&jcy; &rcy;&iecy;&pcy;&ocy;&zcy;&icy;&tcy;&ocy;&rcy;&icy;&jcy;) &yacy;&vcy;&lcy;&yacy;&iecy;&tcy;&scy;&yacy; &ocy;&tcy;&ncy;&ocy;&scy;&icy;&tcy;&iecy;&lcy;&softcy;&ncy;&ycy;&mcy; &pcy;&ucy;&tcy;&iecy;&mcy; &icy; &ocy;&zcy;&ncy;&acy;&chcy;&acy;&iecy;&tcy; &vcy;&acy;&shcy; &tcy;&iecy;&kcy;&ucy;&shchcy;&icy;&jcy; &rcy;&iecy;&pcy;&ocy;&zcy;&icy;&tcy;&ocy;&rcy;&icy;&jcy;.</span></p> </li> </ul> </div> <p><span data-i18n="e4435a66f57d1c2dc1d461a814405a22c9b5934cc174c5e172ffb49287df0dd6/3b" data-source="Here are the rules regarding the &amp;quot;flags&amp;quot; that you should follow when you are scripting Git:" onmousemove="i18n(this)">&Vcy;&ocy;&tcy; &pcy;&rcy;&acy;&vcy;&icy;&lcy;&acy;, &kcy;&acy;&scy;&acy;&yucy;&shchcy;&icy;&iecy;&scy;&yacy;  &quot;flags&quot; , &kcy;&ocy;&tcy;&ocy;&rcy;&ycy;&mcy; &scy;&lcy;&iecy;&dcy;&ucy;&iecy;&tcy; &scy;&lcy;&iecy;&dcy;&ocy;&vcy;&acy;&tcy;&softcy; &pcy;&rcy;&icy; &ncy;&acy;&pcy;&icy;&scy;&acy;&ncy;&icy;&icy; &scy;&tscy;&iecy;&ncy;&acy;&rcy;&icy;&iecy;&vcy; Git:</span></p> <div> <ul> <li> <p><span data-i18n="b3aa14b9dfd34e402ba12f462b95c67595e9b96c0896d287f19720217089bb78/a7" data-source="It&amp;rsquo;s preferred to use the non-dashed form of Git commands, which means that you should prefer &lt;code&gt;git foo&lt;/code&gt; to &lt;code&gt;git-foo&lt;/code&gt;." onmousemove="i18n(this)">&Pcy;&rcy;&iecy;&dcy;&pcy;&ocy;&chcy;&tcy;&icy;&tcy;&iecy;&lcy;&softcy;&ncy;&ocy; &icy;&scy;&pcy;&ocy;&lcy;&softcy;&zcy;&ocy;&vcy;&acy;&tcy;&softcy; &ncy;&iecy;&pcy;&ucy;&ncy;&kcy;&tcy;&icy;&rcy;&ncy;&ucy;&yucy; &fcy;&ocy;&rcy;&mcy;&ucy; &kcy;&ocy;&mcy;&acy;&ncy;&dcy;  Git , &chcy;&tcy;&ocy; &ocy;&zcy;&ncy;&acy;&chcy;&acy;&iecy;&tcy;, &chcy;&tcy;&ocy; &vcy;&acy;&mcy; &scy;&lcy;&iecy;&dcy;&ucy;&iecy;&tcy; &pcy;&rcy;&iecy;&dcy;&pcy;&ocy;&chcy;&iecy;&scy;&tcy;&softcy;  <code>git foo</code> <code>git-foo</code>  .</span></p> </li> <li> <p><span data-i18n="69c0c253422ed846881c6fbe27e82216cb1fe4c7617eca125de7328f73deebc7/94" data-source="Splitting short options to separate words (prefer &lt;code&gt;git foo -a -b&lt;/code&gt; to &lt;code&gt;git foo -ab&lt;/code&gt;, the latter may not even work)." onmousemove="i18n(this)">&Rcy;&acy;&zcy;&bcy;&icy;&iecy;&ncy;&icy;&iecy; &kcy;&ocy;&rcy;&ocy;&tcy;&kcy;&icy;&khcy; &ocy;&pcy;&tscy;&icy;&jcy; &ncy;&acy; &ocy;&tcy;&dcy;&iecy;&lcy;&softcy;&ncy;&ycy;&iecy; &scy;&lcy;&ocy;&vcy;&acy; (&pcy;&rcy;&iecy;&dcy;&pcy;&ocy;&chcy;&icy;&tcy;&acy;&jcy;&tcy;&iecy;  <code>git foo -a -b</code> <code>git foo -ab</code> , &pcy;&ocy;&scy;&lcy;&iecy;&dcy;&ncy;&icy;&jcy; &mcy;&ocy;&zhcy;&iecy;&tcy; &dcy;&acy;&zhcy;&iecy; &ncy;&iecy; &rcy;&acy;&bcy;&ocy;&tcy;&acy;&tcy;&softcy;).</span></p> </li> <li> <p><span data-i18n="6a75e6965c645f74c812717eb08ab3862561a316a49b0ee2d0cea6779e1ed515/47" data-source="When a command-line option takes an argument, use the &lt;code&gt;stuck&lt;/code&gt; form. In other words, write &lt;code&gt;git foo -oArg&lt;/code&gt; instead of &lt;code&gt;git foo -o Arg&lt;/code&gt; for short options, and &lt;code&gt;git foo --long-opt=Arg&lt;/code&gt; instead of &lt;code&gt;git foo --long-opt Arg&lt;/code&gt; for long options. An option that takes optional option-argument must be written in the &lt;code&gt;stuck&lt;/code&gt; form." onmousemove="i18n(this)">&IEcy;&scy;&lcy;&icy; &pcy;&acy;&rcy;&acy;&mcy;&iecy;&tcy;&rcy; &kcy;&ocy;&mcy;&acy;&ncy;&dcy;&ncy;&ocy;&jcy; &scy;&tcy;&rcy;&ocy;&kcy;&icy; &pcy;&rcy;&icy;&ncy;&icy;&mcy;&acy;&iecy;&tcy; &acy;&rcy;&gcy;&ucy;&mcy;&iecy;&ncy;&tcy;, &icy;&scy;&pcy;&ocy;&lcy;&softcy;&zcy;&ucy;&jcy;&tcy;&iecy; &fcy;&ocy;&rcy;&mcy;&ucy;  <code>stuck</code> . &Dcy;&rcy;&ucy;&gcy;&icy;&mcy;&icy; &scy;&lcy;&ocy;&vcy;&acy;&mcy;&icy;, &dcy;&lcy;&yacy; &kcy;&ocy;&rcy;&ocy;&tcy;&kcy;&icy;&khcy; &ocy;&pcy;&tscy;&icy;&ocy;&ncy;&ocy;&vcy; &pcy;&icy;&shcy;&icy;&tcy;&iecy;  <code>git foo -oArg</code>  &vcy;&mcy;&iecy;&scy;&tcy;&ocy;  <code>git foo -o Arg</code>  &icy; &dcy;&lcy;&yacy; &dcy;&lcy;&icy;&ncy;&ncy;&ycy;&khcy; &ocy;&pcy;&tscy;&icy;&ocy;&ncy;&ocy;&vcy;  <code>git foo --long-opt=Arg</code>  &vcy;&mcy;&iecy;&scy;&tcy;&ocy;  <code>git foo --long-opt Arg</code> . &Ocy;&pcy;&tscy;&icy;&yacy;, &kcy;&ocy;&tcy;&ocy;&rcy;&acy;&yacy; &pcy;&rcy;&icy;&ncy;&icy;&mcy;&acy;&iecy;&tcy; &ncy;&iecy;&ocy;&bcy;&yacy;&zcy;&acy;&tcy;&iecy;&lcy;&softcy;&ncy;&ycy;&jcy; &acy;&rcy;&gcy;&ucy;&mcy;&iecy;&ncy;&tcy;-&ocy;&pcy;&tscy;&icy;&yucy;, &dcy;&ocy;&lcy;&zhcy;&ncy;&acy; &bcy;&ycy;&tcy;&softcy; &zcy;&acy;&pcy;&icy;&scy;&acy;&ncy;&acy; &vcy; &fcy;&ocy;&rcy;&mcy;&iecy;  <code>stuck</code> .</span></p> </li> <li> <p><span data-i18n="5857d28ab3b1c76aa97b7736502bc503e1240eeb272babd9de9e53bd5b421099/e0" data-source="When you give a revision parameter to a command, make sure the parameter is not ambiguous with a name of a file in the work tree. E.g. do not write &lt;code&gt;git log -1 HEAD&lt;/code&gt; but write &lt;code&gt;git log -1 HEAD --&lt;/code&gt;; the former will not work if you happen to have a file called &lt;code&gt;HEAD&lt;/code&gt; in the work tree." onmousemove="i18n(this)">&Kcy;&ocy;&gcy;&dcy;&acy; &vcy;&ycy; &zcy;&acy;&dcy;&acy;&iecy;&tcy;&iecy; &kcy;&ocy;&mcy;&acy;&ncy;&dcy;&iecy; &pcy;&acy;&rcy;&acy;&mcy;&iecy;&tcy;&rcy; &rcy;&iecy;&dcy;&acy;&kcy;&tscy;&icy;&icy;, &ucy;&bcy;&iecy;&dcy;&icy;&tcy;&iecy;&scy;&softcy;, &chcy;&tcy;&ocy; &ecy;&tcy;&ocy;&tcy; &pcy;&acy;&rcy;&acy;&mcy;&iecy;&tcy;&rcy; &ncy;&iecy; &yacy;&vcy;&lcy;&yacy;&iecy;&tcy;&scy;&yacy; &dcy;&vcy;&ucy;&scy;&mcy;&ycy;&scy;&lcy;&iecy;&ncy;&ncy;&ycy;&mcy; &scy; &icy;&mcy;&iecy;&ncy;&iecy;&mcy; &fcy;&acy;&jcy;&lcy;&acy; &vcy; &rcy;&acy;&bcy;&ocy;&chcy;&iecy;&mcy; &dcy;&iecy;&rcy;&iecy;&vcy;&iecy;. &Ncy;&acy;&pcy;&rcy;&icy;&mcy;&iecy;&rcy;, &ncy;&iecy; &pcy;&icy;&shcy;&icy;&tcy;&iecy;  <code>git log -1 HEAD</code> , &acy; &pcy;&icy;&shcy;&icy;&tcy;&iecy;  <code>git log -1 HEAD --</code> ; &pcy;&iecy;&rcy;&vcy;&ycy;&jcy; &ncy;&iecy; &bcy;&ucy;&dcy;&iecy;&tcy; &rcy;&acy;&bcy;&ocy;&tcy;&acy;&tcy;&softcy;, &iecy;&scy;&lcy;&icy; &vcy; &rcy;&acy;&bcy;&ocy;&chcy;&iecy;&mcy; &dcy;&iecy;&rcy;&iecy;&vcy;&iecy; &iecy;&scy;&tcy;&softcy; &fcy;&acy;&jcy;&lcy; &scy; &icy;&mcy;&iecy;&ncy;&iecy;&mcy;  <code>HEAD</code> .</span></p> </li> <li> <p><span data-i18n="798ba86404c0f15f96a80210fb09206aa87b5b82e9303ac86bfbbf1c6e580241/27" data-source="Many commands allow a long option &lt;code&gt;--option&lt;/code&gt; to be abbreviated only to their unique prefix (e.g. if there is no other option whose name begins with &lt;code&gt;opt&lt;/code&gt;, you may be able to spell &lt;code&gt;--opt&lt;/code&gt; to invoke the &lt;code&gt;--option&lt;/code&gt; flag), but you should fully spell them out when writing your scripts; later versions of Git may introduce a new option whose name shares the same prefix, e.g. &lt;code&gt;--optimize&lt;/code&gt;, to make a short prefix that used to be unique no longer unique." onmousemove="i18n(this)">&Mcy;&ncy;&ocy;&gcy;&icy;&iecy; &kcy;&ocy;&mcy;&acy;&ncy;&dcy;&ycy; &dcy;&ocy;&pcy;&ucy;&scy;&kcy;&acy;&yucy;&tcy; &scy;&ocy;&kcy;&rcy;&acy;&shchcy;&iecy;&ncy;&icy;&iecy; &dcy;&lcy;&icy;&ncy;&ncy;&ocy;&gcy;&ocy; &pcy;&acy;&rcy;&acy;&mcy;&iecy;&tcy;&rcy;&acy;  <code>--option</code>  &tcy;&ocy;&lcy;&softcy;&kcy;&ocy; &dcy;&ocy; &iecy;&gcy;&ocy; &ucy;&ncy;&icy;&kcy;&acy;&lcy;&softcy;&ncy;&ocy;&gcy;&ocy; &pcy;&rcy;&iecy;&fcy;&icy;&kcy;&scy;&acy; (&ncy;&acy;&pcy;&rcy;&icy;&mcy;&iecy;&rcy;, &iecy;&scy;&lcy;&icy; &ncy;&iecy;&tcy; &dcy;&rcy;&ucy;&gcy;&ocy;&gcy;&ocy; &pcy;&acy;&rcy;&acy;&mcy;&iecy;&tcy;&rcy;&acy;, &icy;&mcy;&yacy; &kcy;&ocy;&tcy;&ocy;&rcy;&ocy;&gcy;&ocy; &ncy;&acy;&chcy;&icy;&ncy;&acy;&iecy;&tcy;&scy;&yacy; &scy;  <code>opt</code>  , &vcy;&ycy; &mcy;&ocy;&zhcy;&iecy;&tcy;&iecy; &ncy;&acy;&pcy;&icy;&scy;&acy;&tcy;&softcy;  <code>--opt</code>  &dcy;&lcy;&yacy; &vcy;&ycy;&zcy;&ocy;&vcy;&acy; &fcy;&lcy;&acy;&gcy;&acy;  <code>--option</code> ), &ncy;&ocy; &vcy;&acy;&mcy; &scy;&lcy;&iecy;&dcy;&ucy;&iecy;&tcy; &pcy;&rcy;&ocy;&pcy;&icy;&scy;&acy;&tcy;&softcy; &icy;&khcy; &pcy;&ocy;&lcy;&ncy;&ocy;&scy;&tcy;&softcy;&yucy;. &pcy;&rcy;&icy; &ncy;&acy;&pcy;&icy;&scy;&acy;&ncy;&icy;&icy; &scy;&vcy;&ocy;&icy;&khcy; &scy;&tscy;&iecy;&ncy;&acy;&rcy;&icy;&iecy;&vcy;; &vcy; &bcy;&ocy;&lcy;&iecy;&iecy; &pcy;&ocy;&zcy;&dcy;&ncy;&icy;&khcy; &vcy;&iecy;&rcy;&scy;&icy;&yacy;&khcy;  Git  &mcy;&ocy;&zhcy;&iecy;&tcy; &pcy;&ocy;&yacy;&vcy;&icy;&tcy;&softcy;&scy;&yacy; &ncy;&ocy;&vcy;&acy;&yacy; &ocy;&pcy;&tscy;&icy;&yacy;, &icy;&mcy;&yacy; &kcy;&ocy;&tcy;&ocy;&rcy;&ocy;&jcy; &icy;&mcy;&iecy;&iecy;&tcy; &tcy;&ocy;&tcy; &zhcy;&iecy; &pcy;&rcy;&iecy;&fcy;&icy;&kcy;&scy;, &ncy;&acy;&pcy;&rcy;&icy;&mcy;&iecy;&rcy;  <code>--optimize</code> , &chcy;&tcy;&ocy;&bcy;&ycy; &scy;&dcy;&iecy;&lcy;&acy;&tcy;&softcy; &kcy;&ocy;&rcy;&ocy;&tcy;&kcy;&icy;&jcy; &pcy;&rcy;&iecy;&fcy;&icy;&kcy;&scy;, &kcy;&ocy;&tcy;&ocy;&rcy;&ycy;&jcy; &rcy;&acy;&ncy;&softcy;&shcy;&iecy; &bcy;&ycy;&lcy; &ucy;&ncy;&icy;&kcy;&acy;&lcy;&softcy;&ncy;&ycy;&mcy;, &bcy;&ocy;&lcy;&softcy;&shcy;&iecy; &ncy;&iecy; &ucy;&ncy;&icy;&kcy;&acy;&lcy;&softcy;&ncy;&ycy;&mcy;.</span></p> </li> </ul> </div> </div> <h2 class="text-body-emphasis"  id="_enhanced_option_parser"><span data-i18n="d3fc5f51c3c05c34eb0e82ffb50f49ad7609adcc09f2fe473e8dfced4dc0dc7b/5a" data-source="Enhanced option parser" onmousemove="i18n(this)">&Rcy;&acy;&scy;&shcy;&icy;&rcy;&iecy;&ncy;&ncy;&ycy;&jcy; &pcy;&acy;&rcy;&scy;&iecy;&rcy; &ocy;&pcy;&tscy;&icy;&jcy;</span></h2> <div> <p><span data-i18n="38482a3d51044ed60ead4e57b0ea68c8ffaadf5cc82fe2d05e21cd53a159d1cb/af" data-source="From the Git 1.5.4 series and further, many Git commands (not all of them at the time of the writing though) come with an enhanced option parser." onmousemove="i18n(this)">&Ncy;&acy;&chcy;&icy;&ncy;&acy;&yacy; &scy; &scy;&iecy;&rcy;&icy;&icy;  Git  1.5.4 &icy; &bcy;&ocy;&lcy;&iecy;&iecy; &pcy;&ocy;&zcy;&dcy;&ncy;&icy;&khcy; &vcy;&iecy;&rcy;&scy;&icy;&jcy;, &mcy;&ncy;&ocy;&gcy;&icy;&iecy; &kcy;&ocy;&mcy;&acy;&ncy;&dcy;&ycy;  Git  (&khcy;&ocy;&tcy;&yacy; &ncy;&iecy; &vcy;&scy;&iecy; &icy;&zcy; &ncy;&icy;&khcy; &ncy;&acy; &mcy;&ocy;&mcy;&iecy;&ncy;&tcy; &ncy;&acy;&pcy;&icy;&scy;&acy;&ncy;&icy;&yacy; &scy;&tcy;&acy;&tcy;&softcy;&icy;) &pcy;&ocy;&scy;&tcy;&acy;&vcy;&lcy;&yacy;&yucy;&tcy;&scy;&yacy; &scy; &rcy;&acy;&scy;&shcy;&icy;&rcy;&iecy;&ncy;&ncy;&ycy;&mcy; &acy;&ncy;&acy;&lcy;&icy;&zcy;&acy;&tcy;&ocy;&rcy;&ocy;&mcy; &pcy;&acy;&rcy;&acy;&mcy;&iecy;&tcy;&rcy;&ocy;&vcy;.</span></p> <p><span data-i18n="64390640c5503102120bae7781415042e8068aff2ede264f1df4e14f9ac2e180/91" data-source="Here is a list of the facilities provided by this option parser." onmousemove="i18n(this)">&Vcy;&ocy;&tcy; &scy;&pcy;&icy;&scy;&ocy;&kcy; &vcy;&ocy;&zcy;&mcy;&ocy;&zhcy;&ncy;&ocy;&scy;&tcy;&iecy;&jcy;, &pcy;&rcy;&iecy;&dcy;&ocy;&scy;&tcy;&acy;&vcy;&lcy;&yacy;&iecy;&mcy;&ycy;&khcy; &ecy;&tcy;&icy;&mcy; &acy;&ncy;&acy;&lcy;&icy;&zcy;&acy;&tcy;&ocy;&rcy;&ocy;&mcy; &ocy;&pcy;&tscy;&icy;&jcy;.</span></p> <div> <h3 class="text-body-emphasis"  id="_magic_options"><span data-i18n="f0acd542d90816b35f4da91c950a1e0d70daea3d2fac3a0e820b9f13ed68101c/51" data-source="Magic Options" onmousemove="i18n(this)">Magic Options</span></h3> <p><span data-i18n="2d5570e5ec2e6bd86431422353b4205e9749dd67b20da927eb670a2e2af88ce9/da" data-source="Commands which have the enhanced option parser activated all understand a couple of magic command-line options:" onmousemove="i18n(this)">&Vcy;&scy;&iecy; &kcy;&ocy;&mcy;&acy;&ncy;&dcy;&ycy;, &ucy; &kcy;&ocy;&tcy;&ocy;&rcy;&ycy;&khcy; &acy;&kcy;&tcy;&icy;&vcy;&icy;&rcy;&ocy;&vcy;&acy;&ncy; &rcy;&acy;&scy;&shcy;&icy;&rcy;&iecy;&ncy;&ncy;&ycy;&jcy; &acy;&ncy;&acy;&lcy;&icy;&zcy;&acy;&tcy;&ocy;&rcy; &pcy;&acy;&rcy;&acy;&mcy;&iecy;&tcy;&rcy;&ocy;&vcy;, &pcy;&ocy;&ncy;&icy;&mcy;&acy;&yucy;&tcy; &pcy;&acy;&rcy;&ucy; &vcy;&ocy;&lcy;&shcy;&iecy;&bcy;&ncy;&ycy;&khcy; &pcy;&acy;&rcy;&acy;&mcy;&iecy;&tcy;&rcy;&ocy;&vcy; &kcy;&ocy;&mcy;&acy;&ncy;&dcy;&ncy;&ocy;&jcy; &scy;&tcy;&rcy;&ocy;&kcy;&icy;:</span></p> <div> <dl> <dt id="Documentation/gitcli.txt--h"><span data-i18n="05dc0e47773fb3a7a4dc132574919f02b6242879820e347dc00a1962a96636b5/9d" data-source="-h" onmousemove="i18n(this)">-h</span></dt> <dd> <p><span data-i18n="d36b2939ec074ca6311c049ac8ab1ee6b1d55fa2e28bfb5d7c2237a3c35a2391/fb" data-source="gives a pretty printed usage of the command." onmousemove="i18n(this)">&dcy;&acy;&iecy;&tcy; &dcy;&ocy;&vcy;&ocy;&lcy;&softcy;&ncy;&ocy; &pcy;&iecy;&chcy;&acy;&tcy;&ncy;&ocy;&iecy; &icy;&scy;&pcy;&ocy;&lcy;&softcy;&zcy;&ocy;&vcy;&acy;&ncy;&icy;&iecy; &kcy;&ocy;&mcy;&acy;&ncy;&dcy;&ycy;.</span></p> <div> <div> <pre class="hljs language-sql">$ git <span class="hljs-keyword">describe</span> <span class="hljs-operator">-</span>h
usage: git <span class="hljs-keyword">describe</span> [<span class="hljs-operator">&lt;</span>options<span class="hljs-operator">&gt;</span>] <span class="hljs-operator">&lt;</span><span class="hljs-keyword">commit</span><span class="hljs-operator">-</span>ish<span class="hljs-operator">&gt;</span><span class="hljs-operator">*</span>
   <span class="hljs-keyword">or</span>: git <span class="hljs-keyword">describe</span> [<span class="hljs-operator">&lt;</span>options<span class="hljs-operator">&gt;</span>] <span class="hljs-comment">--dirty</span>

    <span class="hljs-comment" title="--contains            find the tag that comes after the commit">--contains &ncy;&acy;&jcy;&tcy;&icy; &tcy;&iecy;&gcy;, &kcy;&ocy;&tcy;&ocy;&rcy;&ycy;&jcy; &icy;&dcy;&iecy;&tcy; &pcy;&ocy;&scy;&lcy;&iecy; &fcy;&icy;&kcy;&scy;&acy;&tscy;&icy;&icy;</span>
    <span class="hljs-comment" title="--debug               debug search strategy on stderr">--debug &scy;&tcy;&rcy;&acy;&tcy;&iecy;&gcy;&icy;&yacy; &pcy;&ocy;&icy;&scy;&kcy;&acy; &ocy;&tcy;&lcy;&acy;&dcy;&kcy;&icy; &ncy;&acy; stderr</span>
    <span class="hljs-comment" title="--all                 use any ref">--all &icy;&scy;&pcy;&ocy;&lcy;&softcy;&zcy;&ocy;&vcy;&acy;&tcy;&softcy; &lcy;&yucy;&bcy;&ucy;&yucy; &scy;&scy;&ycy;&lcy;&kcy;&ucy;</span>
    <span class="hljs-comment" title="--tags                use any tag, even unannotated">--tags &icy;&scy;&pcy;&ocy;&lcy;&softcy;&zcy;&ocy;&vcy;&acy;&tcy;&softcy; &lcy;&yucy;&bcy;&ocy;&jcy; &tcy;&iecy;&gcy;, &dcy;&acy;&zhcy;&iecy; &bcy;&iecy;&zcy; &acy;&ncy;&ncy;&ocy;&tcy;&acy;&tscy;&icy;&jcy;</span>
    <span class="hljs-comment" title="--long                always use long format">--long &vcy;&scy;&iecy;&gcy;&dcy;&acy; &icy;&scy;&pcy;&ocy;&lcy;&softcy;&zcy;&ocy;&vcy;&acy;&tcy;&softcy; &dcy;&lcy;&icy;&ncy;&ncy;&ycy;&jcy; &fcy;&ocy;&rcy;&mcy;&acy;&tcy;</span>
    <span class="hljs-comment" title="--abbrev[=&lt;n&gt;]        use &lt;n&gt; digits to display SHA-1s">--abbrev[=&lt;n&gt;] &icy;&scy;&pcy;&ocy;&lcy;&softcy;&zcy;&ocy;&vcy;&acy;&tcy;&softcy; &lt;n&gt; &tscy;&icy;&fcy;&rcy; &dcy;&lcy;&yacy; &ocy;&tcy;&ocy;&bcy;&rcy;&acy;&zhcy;&iecy;&ncy;&icy;&yacy; SHA-1</span></pre> </div> </div> <p><span data-i18n="750c33579ac3d1961428c0ce9dd2b4711eb355b8443df6b0443b3e3f863a0411/3c" data-source="Note that some subcommand (e.g. &lt;code&gt;git grep&lt;/code&gt;) may behave differently when there are things on the command line other than &lt;code&gt;-h&lt;/code&gt;, but &lt;code&gt;git
subcmd -h&lt;/code&gt; without anything else on the command line is meant to consistently give the usage." onmousemove="i18n(this)">&Ocy;&bcy;&rcy;&acy;&tcy;&icy;&tcy;&iecy; &vcy;&ncy;&icy;&mcy;&acy;&ncy;&icy;&iecy;, &chcy;&tcy;&ocy; &ncy;&iecy;&kcy;&ocy;&tcy;&ocy;&rcy;&ycy;&iecy; &pcy;&ocy;&dcy;&kcy;&ocy;&mcy;&acy;&ncy;&dcy;&ycy; (&ncy;&acy;&pcy;&rcy;&icy;&mcy;&iecy;&rcy;,  <code>git grep</code>  ) &mcy;&ocy;&gcy;&ucy;&tcy; &vcy;&iecy;&scy;&tcy;&icy; &scy;&iecy;&bcy;&yacy; &pcy;&ocy;-&dcy;&rcy;&ucy;&gcy;&ocy;&mcy;&ucy;, &iecy;&scy;&lcy;&icy; &vcy; &kcy;&ocy;&mcy;&acy;&ncy;&dcy;&ncy;&ocy;&jcy; &scy;&tcy;&rcy;&ocy;&kcy;&iecy; &iecy;&scy;&tcy;&softcy; &chcy;&tcy;&ocy;-&tcy;&ocy;, &kcy;&rcy;&ocy;&mcy;&iecy;  <code>-h</code>  , &ncy;&ocy;  <code>git
subcmd -h</code>  &bcy;&iecy;&zcy; &chcy;&iecy;&gcy;&ocy;-&lcy;&icy;&bcy;&ocy; &iecy;&shchcy;&iecy; &vcy; &kcy;&ocy;&mcy;&acy;&ncy;&dcy;&ncy;&ocy;&jcy; &scy;&tcy;&rcy;&ocy;&kcy;&iecy; &pcy;&rcy;&iecy;&dcy;&ncy;&acy;&zcy;&ncy;&acy;&chcy;&iecy;&ncy; &dcy;&lcy;&yacy; &pcy;&ocy;&scy;&lcy;&iecy;&dcy;&ocy;&vcy;&acy;&tcy;&iecy;&lcy;&softcy;&ncy;&ocy;&gcy;&ocy; &ucy;&kcy;&acy;&zcy;&acy;&ncy;&icy;&yacy; &icy;&scy;&pcy;&ocy;&lcy;&softcy;&zcy;&ocy;&vcy;&acy;&ncy;&icy;&yacy;.</span></p> </dd> <dt id="Documentation/gitcli.txt---help-all"><span data-i18n="75c4bab73dacfc9f8823d10bfa8afc3a823f3e7c7710b570e8514ea26654f5ea/1c" data-source="--help-all" onmousemove="i18n(this)">--help-all</span></dt> <dd> <p><span data-i18n="b57981b39b233ceabb32e1ec06ec0f4623d31ad3ff01f177363414b6698f7294/02" data-source="Some Git commands take options that are only used for plumbing or that are deprecated, and such options are hidden from the default usage. This option gives the full list of options." onmousemove="i18n(this)">&Ncy;&iecy;&kcy;&ocy;&tcy;&ocy;&rcy;&ycy;&iecy; &kcy;&ocy;&mcy;&acy;&ncy;&dcy;&ycy;  Git  &pcy;&rcy;&icy;&ncy;&icy;&mcy;&acy;&yucy;&tcy; &pcy;&acy;&rcy;&acy;&mcy;&iecy;&tcy;&rcy;&ycy;, &kcy;&ocy;&tcy;&ocy;&rcy;&ycy;&iecy; &icy;&scy;&pcy;&ocy;&lcy;&softcy;&zcy;&ucy;&yucy;&tcy;&scy;&yacy; &tcy;&ocy;&lcy;&softcy;&kcy;&ocy; &dcy;&lcy;&yacy; &vcy;&ocy;&dcy;&ocy;&pcy;&rcy;&ocy;&vcy;&ocy;&dcy;&acy; &icy;&lcy;&icy; &yacy;&vcy;&lcy;&yacy;&yucy;&tcy;&scy;&yacy; &ucy;&scy;&tcy;&acy;&rcy;&iecy;&vcy;&shcy;&icy;&mcy;&icy;, &icy; &tcy;&acy;&kcy;&icy;&iecy; &pcy;&acy;&rcy;&acy;&mcy;&iecy;&tcy;&rcy;&ycy; &scy;&kcy;&rcy;&ycy;&tcy;&ycy; &ocy;&tcy; &icy;&scy;&pcy;&ocy;&lcy;&softcy;&zcy;&ocy;&vcy;&acy;&ncy;&icy;&yacy; &pcy;&ocy; &ucy;&mcy;&ocy;&lcy;&chcy;&acy;&ncy;&icy;&yucy;. &Ecy;&tcy;&acy; &ocy;&pcy;&tscy;&icy;&yacy; &dcy;&acy;&iecy;&tcy; &pcy;&ocy;&lcy;&ncy;&ycy;&jcy; &scy;&pcy;&icy;&scy;&ocy;&kcy; &ocy;&pcy;&tscy;&icy;&jcy;.</span></p> </dd> </dl> </div> </div> <div> <h3 class="text-body-emphasis"  id="_negating_options"><span data-i18n="b34c1c623a9cae57c578b018926f402f9090f2d839080fda71d7129581fb458d/f2" data-source="Negating options" onmousemove="i18n(this)">Negating options</span></h3> <p><span data-i18n="82be592dd8587f3ecf169899b3005899be8993a397b50430190a80257b7e4a54/70" data-source="Options with long option names can be negated by prefixing &lt;code&gt;--no-&lt;/code&gt;. For example, &lt;code&gt;git branch&lt;/code&gt; has the option &lt;code&gt;--track&lt;/code&gt; which is &lt;code&gt;on&lt;/code&gt; by default. You can use &lt;code&gt;--no-track&lt;/code&gt; to override that behaviour. The same goes for &lt;code&gt;--color&lt;/code&gt; and &lt;code&gt;--no-color&lt;/code&gt;." onmousemove="i18n(this)">&Ocy;&pcy;&tscy;&icy;&icy; &scy; &dcy;&lcy;&icy;&ncy;&ncy;&ycy;&mcy;&icy; &icy;&mcy;&iecy;&ncy;&acy;&mcy;&icy; &mcy;&ocy;&zhcy;&ncy;&ocy; &ocy;&tcy;&mcy;&iecy;&ncy;&icy;&tcy;&softcy;, &dcy;&ocy;&bcy;&acy;&vcy;&icy;&vcy; &pcy;&rcy;&iecy;&fcy;&icy;&kcy;&scy;  <code>--no-</code> . &Ncy;&acy;&pcy;&rcy;&icy;&mcy;&iecy;&rcy;,  <code>git branch</code>  &icy;&mcy;&iecy;&iecy;&tcy; &ocy;&pcy;&tscy;&icy;&yucy;  <code>--track</code> , &kcy;&ocy;&tcy;&ocy;&rcy;&acy;&yacy; &pcy;&ocy; &ucy;&mcy;&ocy;&lcy;&chcy;&acy;&ncy;&icy;&yucy; &mdash;  <code>on</code> . &Vcy;&ycy; &mcy;&ocy;&zhcy;&iecy;&tcy;&iecy; &icy;&scy;&pcy;&ocy;&lcy;&softcy;&zcy;&ocy;&vcy;&acy;&tcy;&softcy;  <code>--no-track</code> , &chcy;&tcy;&ocy;&bcy;&ycy; &icy;&zcy;&mcy;&iecy;&ncy;&icy;&tcy;&softcy; &ecy;&tcy;&ocy; &pcy;&ocy;&vcy;&iecy;&dcy;&iecy;&ncy;&icy;&iecy;. &Tcy;&ocy; &zhcy;&iecy; &scy;&acy;&mcy;&ocy;&iecy; &kcy;&acy;&scy;&acy;&iecy;&tcy;&scy;&yacy;  <code>--color</code>  &icy;  <code>--no-color</code> .</span></p> </div> <div> <h3 class="text-body-emphasis"  id="_aggregating_short_options"><span data-i18n="0a7365be951cf4169a3537754e1bd3662ce62701dd0e3c083ea63932d9906a57/2d" data-source="Aggregating short options" onmousemove="i18n(this)">&Acy;&gcy;&rcy;&iecy;&gcy;&icy;&rcy;&ocy;&vcy;&acy;&ncy;&icy;&iecy; &kcy;&ocy;&rcy;&ocy;&tcy;&kcy;&icy;&khcy; &ocy;&pcy;&tscy;&icy;&ocy;&ncy;&ocy;&vcy;</span></h3> <p><span data-i18n="2cb69ab200f49a96cc466b291b29e5318dc1e34f27901f6988dc6c6360d232d3/c1" data-source="Commands that support the enhanced option parser allow you to aggregate short options. This means that you can for example use &lt;code&gt;git rm -rf&lt;/code&gt; or &lt;code&gt;git clean -fdx&lt;/code&gt;." onmousemove="i18n(this)">&Kcy;&ocy;&mcy;&acy;&ncy;&dcy;&ycy;, &pcy;&ocy;&dcy;&dcy;&iecy;&rcy;&zhcy;&icy;&vcy;&acy;&yucy;&shchcy;&icy;&iecy; &rcy;&acy;&scy;&shcy;&icy;&rcy;&iecy;&ncy;&ncy;&ycy;&jcy; &acy;&ncy;&acy;&lcy;&icy;&zcy;&acy;&tcy;&ocy;&rcy; &pcy;&acy;&rcy;&acy;&mcy;&iecy;&tcy;&rcy;&ocy;&vcy;, &pcy;&ocy;&zcy;&vcy;&ocy;&lcy;&yacy;&yucy;&tcy; &ocy;&bcy;&hardcy;&iecy;&dcy;&icy;&ncy;&yacy;&tcy;&softcy; &kcy;&ocy;&rcy;&ocy;&tcy;&kcy;&icy;&iecy; &pcy;&acy;&rcy;&acy;&mcy;&iecy;&tcy;&rcy;&ycy;. &Ecy;&tcy;&ocy; &ocy;&zcy;&ncy;&acy;&chcy;&acy;&iecy;&tcy;, &chcy;&tcy;&ocy; &vcy;&ycy; &mcy;&ocy;&zhcy;&iecy;&tcy;&iecy; &icy;&scy;&pcy;&ocy;&lcy;&softcy;&zcy;&ocy;&vcy;&acy;&tcy;&softcy;, &ncy;&acy;&pcy;&rcy;&icy;&mcy;&iecy;&rcy;,  <code>git rm -rf</code>  &icy;&lcy;&icy;  <code>git clean -fdx</code> .</span></p> </div> <div> <h3 class="text-body-emphasis"  id="_abbreviating_long_options"><span data-i18n="ebf8ffa7f385fcc43c61df2b75c6194209240d94933e01b73d3204ae3c37ced0/3a" data-source="Abbreviating long options" onmousemove="i18n(this)">&Scy;&ocy;&kcy;&rcy;&acy;&shchcy;&iecy;&ncy;&icy;&iecy; &dcy;&lcy;&icy;&ncy;&ncy;&ycy;&khcy; &ocy;&pcy;&tscy;&icy;&jcy;</span></h3> <p><span data-i18n="3a71407c20cad638d7dcea2f8964c75c7bb25d0c18f6e9bdb5a100439891bb70/78" data-source="Commands that support the enhanced option parser accepts unique prefix of a long option as if it is fully spelled out, but use this with a caution. For example, &lt;code&gt;git commit --amen&lt;/code&gt; behaves as if you typed &lt;code&gt;git commit --amend&lt;/code&gt;, but that is true only until a later version of Git introduces another option that shares the same prefix, e.g. &lt;code&gt;git commit --amenity&lt;/code&gt; option." onmousemove="i18n(this)">&Kcy;&ocy;&mcy;&acy;&ncy;&dcy;&ycy;, &pcy;&ocy;&dcy;&dcy;&iecy;&rcy;&zhcy;&icy;&vcy;&acy;&yucy;&shchcy;&icy;&iecy; &rcy;&acy;&scy;&shcy;&icy;&rcy;&iecy;&ncy;&ncy;&ycy;&jcy; &acy;&ncy;&acy;&lcy;&icy;&zcy;&acy;&tcy;&ocy;&rcy; &pcy;&acy;&rcy;&acy;&mcy;&iecy;&tcy;&rcy;&ocy;&vcy;, &pcy;&rcy;&icy;&ncy;&icy;&mcy;&acy;&yucy;&tcy; &ucy;&ncy;&icy;&kcy;&acy;&lcy;&softcy;&ncy;&ycy;&jcy; &pcy;&rcy;&iecy;&fcy;&icy;&kcy;&scy; &dcy;&lcy;&icy;&ncy;&ncy;&ocy;&gcy;&ocy; &pcy;&acy;&rcy;&acy;&mcy;&iecy;&tcy;&rcy;&acy;, &kcy;&acy;&kcy; &iecy;&scy;&lcy;&icy; &bcy;&ycy; &ocy;&ncy; &bcy;&ycy;&lcy; &pcy;&ocy;&lcy;&ncy;&ocy;&scy;&tcy;&softcy;&yucy; &ncy;&acy;&pcy;&icy;&scy;&acy;&ncy;, &ncy;&ocy; &icy;&scy;&pcy;&ocy;&lcy;&softcy;&zcy;&ucy;&jcy;&tcy;&iecy; &iecy;&gcy;&ocy; &scy; &ocy;&scy;&tcy;&ocy;&rcy;&ocy;&zhcy;&ncy;&ocy;&scy;&tcy;&softcy;&yucy;. &Ncy;&acy;&pcy;&rcy;&icy;&mcy;&iecy;&rcy;,  <code>git commit --amen</code>  &vcy;&iecy;&dcy;&iecy;&tcy; &scy;&iecy;&bcy;&yacy; &tcy;&acy;&kcy;, &kcy;&acy;&kcy; &iecy;&scy;&lcy;&icy; &bcy;&ycy; &vcy;&ycy; &ncy;&acy;&bcy;&rcy;&acy;&lcy;&icy;  <code>git commit --amend</code>  , &ncy;&ocy; &ecy;&tcy;&ocy; &bcy;&ucy;&dcy;&iecy;&tcy;  true  &tcy;&ocy;&lcy;&softcy;&kcy;&ocy; &dcy;&ocy; &tcy;&iecy;&khcy; &pcy;&ocy;&rcy;, &pcy;&ocy;&kcy;&acy; &vcy; &bcy;&ocy;&lcy;&iecy;&iecy; &pcy;&ocy;&zcy;&dcy;&ncy;&iecy;&jcy; &vcy;&iecy;&rcy;&scy;&icy;&icy;  Git  &ncy;&iecy; &pcy;&ocy;&yacy;&vcy;&icy;&tcy;&scy;&yacy; &dcy;&rcy;&ucy;&gcy;&acy;&yacy; &ocy;&pcy;&tscy;&icy;&yacy; &scy; &tcy;&iecy;&mcy; &zhcy;&iecy; &pcy;&rcy;&iecy;&fcy;&icy;&kcy;&scy;&ocy;&mcy;, &ncy;&acy;&pcy;&rcy;&icy;&mcy;&iecy;&rcy; &ocy;&pcy;&tscy;&icy;&yacy;  <code>git commit --amenity</code> .</span></p> </div> <div> <h3 class="text-body-emphasis"  id="_separating_argument_from_the_option"><span data-i18n="787572d82662984baa0703c90fdbf6e940e36704241ccb7546a4f44109edefb6/32" data-source="Separating argument from the option" onmousemove="i18n(this)">&Ocy;&tcy;&dcy;&iecy;&lcy;&iecy;&ncy;&icy;&iecy; &acy;&rcy;&gcy;&ucy;&mcy;&iecy;&ncy;&tcy;&acy; &ocy;&tcy; &ocy;&pcy;&tscy;&icy;&icy;</span></h3> <p><span data-i18n="64e6f45ea87305cca6863e9e8d46cf998db68b374d26a5f86ab23c8d35e4c026/ca" data-source="You can write the mandatory option parameter to an option as a separate word on the command line. That means that all the following uses work:" onmousemove="i18n(this)">&Vcy;&ycy; &mcy;&ocy;&zhcy;&iecy;&tcy;&iecy; &zcy;&acy;&pcy;&icy;&scy;&acy;&tcy;&softcy; &ocy;&bcy;&yacy;&zcy;&acy;&tcy;&iecy;&lcy;&softcy;&ncy;&ycy;&jcy; &pcy;&acy;&rcy;&acy;&mcy;&iecy;&tcy;&rcy; &ocy;&pcy;&tscy;&icy;&icy; &vcy; &vcy;&icy;&dcy;&iecy; &ocy;&tcy;&dcy;&iecy;&lcy;&softcy;&ncy;&ocy;&gcy;&ocy; &scy;&lcy;&ocy;&vcy;&acy; &vcy; &kcy;&ocy;&mcy;&acy;&ncy;&dcy;&ncy;&ocy;&jcy; &scy;&tcy;&rcy;&ocy;&kcy;&iecy;. &Ecy;&tcy;&ocy; &ocy;&zcy;&ncy;&acy;&chcy;&acy;&iecy;&tcy;, &chcy;&tcy;&ocy; &vcy;&scy;&iecy; &scy;&lcy;&iecy;&dcy;&ucy;&yucy;&shchcy;&icy;&iecy; &vcy;&acy;&rcy;&icy;&acy;&ncy;&tcy;&ycy; &icy;&scy;&pcy;&ocy;&lcy;&softcy;&zcy;&ocy;&vcy;&acy;&ncy;&icy;&yacy; &rcy;&acy;&bcy;&ocy;&tcy;&acy;&yucy;&tcy;:</span></p> <div> <div> <pre class="hljs language-ruby"><span class="hljs-variable">$ </span>git foo --long-opt=<span class="hljs-title class_">Arg</span>
<span class="hljs-variable">$ </span>git foo --long-opt <span class="hljs-title class_">Arg</span>
<span class="hljs-variable">$ </span>git foo -oArg
<span class="hljs-variable">$ </span>git foo -o <span class="hljs-title class_">Arg</span></pre> </div> </div> <p><span data-i18n="003dec3a375b480ca0eac17f1b13a064a13cff9f86158b722a6df6da069821d6/f1" data-source="However, this is &lt;strong&gt;NOT&lt;/strong&gt; allowed for switches with an optional value, where the &lt;code&gt;stuck&lt;/code&gt; form must be used:" onmousemove="i18n(this)">&Ocy;&dcy;&ncy;&acy;&kcy;&ocy; &ecy;&tcy;&ocy; &Ncy;&IEcy; &rcy;&acy;&zcy;&rcy;&iecy;&shcy;&iecy;&ncy;&ocy; &dcy;&lcy;&yacy; &pcy;&iecy;&rcy;&iecy;&kcy;&lcy;&yucy;&chcy;&acy;&tcy;&iecy;&lcy;&iecy;&jcy; &scy; &ncy;&iecy;&ocy;&bcy;&yacy;&zcy;&acy;&tcy;&iecy;&lcy;&softcy;&ncy;&ycy;&mcy; &zcy;&ncy;&acy;&chcy;&iecy;&ncy;&icy;&iecy;&mcy;, &gcy;&dcy;&iecy; &ncy;&iecy;&ocy;&bcy;&khcy;&ocy;&dcy;&icy;&mcy;&ocy; &icy;&scy;&pcy;&ocy;&lcy;&softcy;&zcy;&ocy;&vcy;&acy;&tcy;&softcy; &fcy;&ocy;&rcy;&mcy;&ucy;  <code>stuck</code> :</span></p> <div> <div> <pre class="hljs language-sql">$ git <span class="hljs-keyword">describe</span> <span class="hljs-comment" title="--abbrev HEAD     # correct">--abbrev HEAD # &pcy;&rcy;&acy;&vcy;&icy;&lcy;&softcy;&ncy;&ocy;</span>
$ git <span class="hljs-keyword">describe</span> <span class="hljs-comment" title="--abbrev=10 HEAD  # correct">--abbrev=10 HEAD # &pcy;&rcy;&acy;&vcy;&icy;&lcy;&softcy;&ncy;&ocy;</span>
$ git <span class="hljs-keyword">describe</span> <span class="hljs-comment" title="--abbrev 10 HEAD  # NOT WHAT YOU MEANT">--abbrev 10 HEAD # &Ncy;&IEcy; &CHcy;&Tcy;&Ocy; &Vcy;&Ycy; &icy;&mcy;&iecy;&lcy;&icy; &vcy; &vcy;&icy;&dcy;&ucy;</span></pre> </div> </div> </div> </div> <h2 class="text-body-emphasis"  id="_notes_on_frequently_confused_options"><span data-i18n="ea3549c3ab4333c1423c4aa0da2a55f863ac91503ab842ca9f3ffc6f836d9d40/78" data-source="Notes on frequently confused options" onmousemove="i18n(this)">&Pcy;&rcy;&icy;&mcy;&iecy;&chcy;&acy;&ncy;&icy;&yacy; &kcy; &ocy;&pcy;&tscy;&icy;&yacy;&mcy;, &kcy;&ocy;&tcy;&ocy;&rcy;&ycy;&iecy; &chcy;&acy;&scy;&tcy;&ocy; &pcy;&ucy;&tcy;&acy;&yucy;&tcy;</span></h2> <div> <p><span data-i18n="f67def943c8c85bdfbe6a191c2b8f492e8254361f06b2b21c0b61fd0a2482220/0f" data-source="Many commands that can work on files in the working tree and/or in the index can take &lt;code&gt;--cached&lt;/code&gt; and/or &lt;code&gt;--index&lt;/code&gt; options. Sometimes people incorrectly think that, because the index was originally called cache, these two are synonyms. They are &lt;strong&gt;not&lt;/strong&gt; &amp;mdash; these two options mean very different things." onmousemove="i18n(this)">&Mcy;&ncy;&ocy;&gcy;&icy;&iecy; &kcy;&ocy;&mcy;&acy;&ncy;&dcy;&ycy;, &kcy;&ocy;&tcy;&ocy;&rcy;&ycy;&iecy; &mcy;&ocy;&gcy;&ucy;&tcy; &rcy;&acy;&bcy;&ocy;&tcy;&acy;&tcy;&softcy; &scy; &fcy;&acy;&jcy;&lcy;&acy;&mcy;&icy; &vcy; &rcy;&acy;&bcy;&ocy;&chcy;&iecy;&mcy; &dcy;&iecy;&rcy;&iecy;&vcy;&iecy; &icy;/&icy;&lcy;&icy; &icy;&ncy;&dcy;&iecy;&kcy;&scy;&iecy;, &mcy;&ocy;&gcy;&ucy;&tcy; &pcy;&rcy;&icy;&ncy;&icy;&mcy;&acy;&tcy;&softcy; &pcy;&acy;&rcy;&acy;&mcy;&iecy;&tcy;&rcy;&ycy;  <code>--cached</code>  &icy;/&icy;&lcy;&icy;  <code>--index</code> . &Icy;&ncy;&ocy;&gcy;&dcy;&acy; &lcy;&yucy;&dcy;&icy; &ocy;&shcy;&icy;&bcy;&ocy;&chcy;&ncy;&ocy; &pcy;&ocy;&lcy;&acy;&gcy;&acy;&yucy;&tcy;, &chcy;&tcy;&ocy;, &pcy;&ocy;&scy;&kcy;&ocy;&lcy;&softcy;&kcy;&ucy; &icy;&ncy;&dcy;&iecy;&kcy;&scy; &icy;&zcy;&ncy;&acy;&chcy;&acy;&lcy;&softcy;&ncy;&ocy; &ncy;&acy;&zcy;&ycy;&vcy;&acy;&lcy;&scy;&yacy; &kcy;&iecy;&shcy;&iecy;&mcy;, &ecy;&tcy;&icy; &dcy;&vcy;&acy; &scy;&lcy;&ocy;&vcy;&acy; &yacy;&vcy;&lcy;&yacy;&yucy;&tcy;&scy;&yacy; &scy;&icy;&ncy;&ocy;&ncy;&icy;&mcy;&acy;&mcy;&icy;. &Ecy;&tcy;&ocy; &ncy;&iecy; &tcy;&acy;&kcy; &mdash; &ecy;&tcy;&icy; &dcy;&vcy;&acy; &vcy;&acy;&rcy;&icy;&acy;&ncy;&tcy;&acy; &ocy;&zcy;&ncy;&acy;&chcy;&acy;&yucy;&tcy; &scy;&ocy;&vcy;&iecy;&rcy;&shcy;&iecy;&ncy;&ncy;&ocy; &rcy;&acy;&zcy;&ncy;&ycy;&iecy; &vcy;&iecy;&shchcy;&icy;.</span></p> <div> <ul> <li> <p><span data-i18n="96667e801e364aefd05c21e7b9c2b3ad46b3c205cc9ffe4a07b7e1f4a2bf9a88/9c" data-source="The &lt;code&gt;--cached&lt;/code&gt; option is used to ask a command that usually works on files in the working tree to &lt;strong&gt;only&lt;/strong&gt; work with the index. For example, &lt;code&gt;git grep&lt;/code&gt;, when used without a commit to specify from which commit to look for strings in, usually works on files in the working tree, but with the &lt;code&gt;--cached&lt;/code&gt; option, it looks for strings in the index." onmousemove="i18n(this)">&Ocy;&pcy;&tscy;&icy;&yacy;  <code>--cached</code>  &icy;&scy;&pcy;&ocy;&lcy;&softcy;&zcy;&ucy;&iecy;&tcy;&scy;&yacy; &dcy;&lcy;&yacy; &zcy;&acy;&pcy;&rcy;&ocy;&scy;&acy; &kcy;&ocy;&mcy;&acy;&ncy;&dcy;&ycy;, &kcy;&ocy;&tcy;&ocy;&rcy;&acy;&yacy; &ocy;&bcy;&ycy;&chcy;&ncy;&ocy; &rcy;&acy;&bcy;&ocy;&tcy;&acy;&iecy;&tcy; &scy; &fcy;&acy;&jcy;&lcy;&acy;&mcy;&icy; &vcy; &rcy;&acy;&bcy;&ocy;&chcy;&iecy;&mcy; &dcy;&iecy;&rcy;&iecy;&vcy;&iecy;, &rcy;&acy;&bcy;&ocy;&tcy;&acy;&tcy;&softcy; &tcy;&ocy;&lcy;&softcy;&kcy;&ocy; &scy; &icy;&ncy;&dcy;&iecy;&kcy;&scy;&ocy;&mcy;. &Ncy;&acy;&pcy;&rcy;&icy;&mcy;&iecy;&rcy;,  <code>git grep</code>  &pcy;&rcy;&icy; &icy;&scy;&pcy;&ocy;&lcy;&softcy;&zcy;&ocy;&vcy;&acy;&ncy;&icy;&icy; &bcy;&iecy;&zcy; &fcy;&icy;&kcy;&scy;&acy;&tscy;&icy;&icy; &dcy;&lcy;&yacy; &ucy;&kcy;&acy;&zcy;&acy;&ncy;&icy;&yacy;, &vcy; &kcy;&acy;&kcy;&ocy;&jcy; &fcy;&icy;&kcy;&scy;&acy;&tscy;&icy;&icy; &icy;&scy;&kcy;&acy;&tcy;&softcy; &scy;&tcy;&rcy;&ocy;&kcy;&icy;, &ocy;&bcy;&ycy;&chcy;&ncy;&ocy; &rcy;&acy;&bcy;&ocy;&tcy;&acy;&iecy;&tcy; &scy; &fcy;&acy;&jcy;&lcy;&acy;&mcy;&icy; &vcy; &rcy;&acy;&bcy;&ocy;&chcy;&iecy;&mcy; &dcy;&iecy;&rcy;&iecy;&vcy;&iecy;, &ncy;&ocy; &scy; &ocy;&pcy;&tscy;&icy;&iecy;&jcy;  <code>--cached</code>  &ocy;&ncy;&acy; &icy;&shchcy;&iecy;&tcy; &scy;&tcy;&rcy;&ocy;&kcy;&icy; &vcy; &icy;&ncy;&dcy;&iecy;&kcy;&scy;&iecy;.</span></p> </li> <li> <p><span data-i18n="76c824540d6a82cb4b41e2aae7d86f7cbb006077f76413a7899bd923a9c70d13/7a" data-source="The &lt;code&gt;--index&lt;/code&gt; option is used to ask a command that usually works on files in the working tree to &lt;strong&gt;also&lt;/strong&gt; affect the index. For example, &lt;code&gt;git stash apply&lt;/code&gt; usually merges changes recorded in a stash entry to the working tree, but with the &lt;code&gt;--index&lt;/code&gt; option, it also merges changes to the index as well." onmousemove="i18n(this)">&Ocy;&pcy;&tscy;&icy;&yacy;  <code>--index</code>  &icy;&scy;&pcy;&ocy;&lcy;&softcy;&zcy;&ucy;&iecy;&tcy;&scy;&yacy;, &chcy;&tcy;&ocy;&bcy;&ycy; &pcy;&ocy;&pcy;&rcy;&ocy;&scy;&icy;&tcy;&softcy; &kcy;&ocy;&mcy;&acy;&ncy;&dcy;&ucy;, &kcy;&ocy;&tcy;&ocy;&rcy;&acy;&yacy; &ocy;&bcy;&ycy;&chcy;&ncy;&ocy; &rcy;&acy;&bcy;&ocy;&tcy;&acy;&iecy;&tcy; &scy; &fcy;&acy;&jcy;&lcy;&acy;&mcy;&icy; &vcy; &rcy;&acy;&bcy;&ocy;&chcy;&iecy;&mcy; &dcy;&iecy;&rcy;&iecy;&vcy;&iecy;, &tcy;&acy;&kcy;&zhcy;&iecy; &pcy;&ocy;&vcy;&lcy;&icy;&yacy;&tcy;&softcy; &ncy;&acy; &icy;&ncy;&dcy;&iecy;&kcy;&scy;. &Ncy;&acy;&pcy;&rcy;&icy;&mcy;&iecy;&rcy;,  <code>git stash apply</code>  &ocy;&bcy;&ycy;&chcy;&ncy;&ocy; &ocy;&bcy;&hardcy;&iecy;&dcy;&icy;&ncy;&yacy;&iecy;&tcy; &icy;&zcy;&mcy;&iecy;&ncy;&iecy;&ncy;&icy;&yacy;, &zcy;&acy;&pcy;&icy;&scy;&acy;&ncy;&ncy;&ycy;&iecy; &vcy; &zcy;&acy;&pcy;&icy;&scy;&icy; &tcy;&acy;&jcy;&ncy;&icy;&kcy;&acy;, &vcy; &rcy;&acy;&bcy;&ocy;&chcy;&iecy;&iecy; &dcy;&iecy;&rcy;&iecy;&vcy;&ocy;, &ncy;&ocy; &scy; &pcy;&ocy;&mcy;&ocy;&shchcy;&softcy;&yucy; &ocy;&pcy;&tscy;&icy;&icy;  <code>--index</code>  &ocy;&ncy; &tcy;&acy;&kcy;&zhcy;&iecy; &ocy;&bcy;&hardcy;&iecy;&dcy;&icy;&ncy;&yacy;&iecy;&tcy; &icy;&zcy;&mcy;&iecy;&ncy;&iecy;&ncy;&icy;&yacy; &icy; &scy; &icy;&ncy;&dcy;&iecy;&kcy;&scy;&ocy;&mcy;.</span></p> </li> </ul> </div> <p><span data-i18n="3abad5272f94849bf807c7eb086d213079ce86177ebb257c3d95f6441155b447/52" data-source="&lt;code&gt;git apply&lt;/code&gt; command can be used with &lt;code&gt;--cached&lt;/code&gt; and &lt;code&gt;--index&lt;/code&gt; (but not at the same time). Usually the command only affects the files in the working tree, but with &lt;code&gt;--index&lt;/code&gt;, it patches both the files and their index entries, and with &lt;code&gt;--cached&lt;/code&gt;, it modifies only the index entries." onmousemove="i18n(this)">&Kcy;&ocy;&mcy;&acy;&ncy;&dcy;&acy;  <code>git apply</code>  &mcy;&ocy;&zhcy;&iecy;&tcy; &icy;&scy;&pcy;&ocy;&lcy;&softcy;&zcy;&ocy;&vcy;&acy;&tcy;&softcy;&scy;&yacy; &scy;  <code>--cached</code>  &icy;  <code>--index</code>  (&ncy;&ocy; &ncy;&iecy; &ocy;&dcy;&ncy;&ocy;&vcy;&rcy;&iecy;&mcy;&iecy;&ncy;&ncy;&ocy;). &Ocy;&bcy;&ycy;&chcy;&ncy;&ocy; &kcy;&ocy;&mcy;&acy;&ncy;&dcy;&acy; &vcy;&lcy;&icy;&yacy;&iecy;&tcy; &tcy;&ocy;&lcy;&softcy;&kcy;&ocy; &ncy;&acy; &fcy;&acy;&jcy;&lcy;&ycy; &vcy; &rcy;&acy;&bcy;&ocy;&chcy;&iecy;&mcy; &dcy;&iecy;&rcy;&iecy;&vcy;&iecy;, &ncy;&ocy; &scy;  <code>--index</code>  &ocy;&ncy;&acy; &icy;&scy;&pcy;&rcy;&acy;&vcy;&lcy;&yacy;&iecy;&tcy; &kcy;&acy;&kcy; &fcy;&acy;&jcy;&lcy;&ycy;, &tcy;&acy;&kcy; &icy; &icy;&khcy; &zcy;&acy;&pcy;&icy;&scy;&icy; &icy;&ncy;&dcy;&iecy;&kcy;&scy;&acy;, &acy; &scy;  <code>--cached</code>  &ocy;&ncy;&acy; &icy;&zcy;&mcy;&iecy;&ncy;&yacy;&iecy;&tcy; &tcy;&ocy;&lcy;&softcy;&kcy;&ocy; &zcy;&acy;&pcy;&icy;&scy;&icy; &icy;&ncy;&dcy;&iecy;&kcy;&scy;&acy;.</span></p> <p><span data-i18n="28267053e9bf45059d553e8b9249d66b27015582adc549842a4b32683d37122d/19" data-source="See also &lt;a href=&quot;https://lore.kernel.org/git/7v64clg5u9.fsf@assigned-by-dhcp.cox.net/&quot;&gt;https://lore.kernel.org/git/7v64clg5u9.fsf@assigned-by-dhcp.cox.net/&lt;/a&gt; and &lt;a href=&quot;https://lore.kernel.org/git/7vy7ej9g38.fsf@gitster.siamese.dyndns.org/&quot;&gt;https://lore.kernel.org/git/7vy7ej9g38.fsf@gitster.siamese.dyndns.org/&lt;/a&gt; for further information." onmousemove="i18n(this)">&Dcy;&ocy;&pcy;&ocy;&lcy;&ncy;&icy;&tcy;&iecy;&lcy;&softcy;&ncy;&ucy;&yucy; &icy;&ncy;&fcy;&ocy;&rcy;&mcy;&acy;&tscy;&icy;&yucy; &scy;&mcy;. &tcy;&acy;&kcy;&zhcy;&iecy; &vcy;  <a href="https://lore.kernel.org/git/7v64clg5u9.fsf@assigned-by-dhcp.cox.net/">https://lore.kernel.org/git/<span class="__cf_email__" data-cfemail="0c3b7a3a386f606b397935226a7f6a4c6d7f7f656b626968216e752168646f7c226f637422626978">[email&#160;protected]</span>/</a>  &icy;  <a href="https://lore.kernel.org/git/7vy7ej9g38.fsf@gitster.siamese.dyndns.org/">https://lore.kernel.org/git/<span class="__cf_email__" data-cfemail="ecdb9a95db8986d58bdfd4c28a9f8aac8b85989f98899ec29f858d81899f89c288958288829fc2839e8b">[email&#160;protected]</span>/</a> .</span></p> <p><span data-i18n="c28bee95844a679f2eaf394e0bdf4bcf1c7bd7440f72e5ebcdddb5ede74992ae/c2" data-source="Some other commands that also work on files in the working tree and/or in the index can take &lt;code&gt;--staged&lt;/code&gt; and/or &lt;code&gt;--worktree&lt;/code&gt;." onmousemove="i18n(this)">&Ncy;&iecy;&kcy;&ocy;&tcy;&ocy;&rcy;&ycy;&iecy; &dcy;&rcy;&ucy;&gcy;&icy;&iecy; &kcy;&ocy;&mcy;&acy;&ncy;&dcy;&ycy;, &kcy;&ocy;&tcy;&ocy;&rcy;&ycy;&iecy; &tcy;&acy;&kcy;&zhcy;&iecy; &rcy;&acy;&bcy;&ocy;&tcy;&acy;&yucy;&tcy; &scy; &fcy;&acy;&jcy;&lcy;&acy;&mcy;&icy; &vcy; &rcy;&acy;&bcy;&ocy;&chcy;&iecy;&mcy; &dcy;&iecy;&rcy;&iecy;&vcy;&iecy; &icy;/&icy;&lcy;&icy; &icy;&ncy;&dcy;&iecy;&kcy;&scy;&iecy;, &mcy;&ocy;&gcy;&ucy;&tcy; &icy;&scy;&pcy;&ocy;&lcy;&softcy;&zcy;&ocy;&vcy;&acy;&tcy;&softcy;  <code>--staged</code>  &icy;/&icy;&lcy;&icy;  <code>--worktree</code>  .</span></p> <div> <ul> <li> <p><span data-i18n="a6df5615eb89d9e97cf51a65ac4c426e1c1149abcd50bb414586769f908e13db/58" data-source="&lt;code&gt;--staged&lt;/code&gt; is exactly like &lt;code&gt;--cached&lt;/code&gt;, which is used to ask a command to only work on the index, not the working tree." onmousemove="i18n(this)"><code>--staged</code>  &tcy;&ocy;&chcy;&ncy;&ocy; &tcy;&acy;&kcy;&ocy;&jcy; &zhcy;&iecy;, &kcy;&acy;&kcy;  <code>--cached</code> , &kcy;&ocy;&tcy;&ocy;&rcy;&ycy;&jcy; &icy;&scy;&pcy;&ocy;&lcy;&softcy;&zcy;&ucy;&iecy;&tcy;&scy;&yacy; &dcy;&lcy;&yacy; &zcy;&acy;&pcy;&rcy;&ocy;&scy;&acy; &kcy;&ocy;&mcy;&acy;&ncy;&dcy;&ycy; &rcy;&acy;&bcy;&ocy;&tcy;&acy;&tcy;&softcy; &tcy;&ocy;&lcy;&softcy;&kcy;&ocy; &scy; &icy;&ncy;&dcy;&iecy;&kcy;&scy;&ocy;&mcy;, &acy; &ncy;&iecy; &scy; &rcy;&acy;&bcy;&ocy;&chcy;&icy;&mcy; &dcy;&iecy;&rcy;&iecy;&vcy;&ocy;&mcy;.</span></p> </li> <li> <p><span data-i18n="7c609679fda1ea667f396b35372638e366219e7fec466d8aaa163020d8308f38/39" data-source="&lt;code&gt;--worktree&lt;/code&gt; is the opposite, to ask a command to work on the working tree only, not the index." onmousemove="i18n(this)"><code>--worktree</code>  &mdash; &ncy;&acy;&ocy;&bcy;&ocy;&rcy;&ocy;&tcy;: &pcy;&ocy;&pcy;&rcy;&ocy;&scy;&icy;&tcy;&softcy; &kcy;&ocy;&mcy;&acy;&ncy;&dcy;&ucy; &rcy;&acy;&bcy;&ocy;&tcy;&acy;&tcy;&softcy; &tcy;&ocy;&lcy;&softcy;&kcy;&ocy; &scy; &rcy;&acy;&bcy;&ocy;&chcy;&icy;&mcy; &dcy;&iecy;&rcy;&iecy;&vcy;&ocy;&mcy;, &acy; &ncy;&iecy; &scy; &icy;&ncy;&dcy;&iecy;&kcy;&scy;&ocy;&mcy;.</span></p> </li> <li> <p><span data-i18n="17f5828c78abd5b3a74f279512402450453c3a730bc05466629d48140fc6d46b/6d" data-source="The two options can be specified together to ask a command to work on both the index and the working tree." onmousemove="i18n(this)">&Ecy;&tcy;&icy; &dcy;&vcy;&iecy; &ocy;&pcy;&tscy;&icy;&icy; &mcy;&ocy;&zhcy;&ncy;&ocy; &ucy;&kcy;&acy;&zcy;&acy;&tcy;&softcy; &vcy;&mcy;&iecy;&scy;&tcy;&iecy;, &chcy;&tcy;&ocy;&bcy;&ycy; &kcy;&ocy;&mcy;&acy;&ncy;&dcy;&acy; &rcy;&acy;&bcy;&ocy;&tcy;&acy;&lcy;&acy; &kcy;&acy;&kcy; &scy; &icy;&ncy;&dcy;&iecy;&kcy;&scy;&ocy;&mcy;, &tcy;&acy;&kcy; &icy; &scy; &rcy;&acy;&bcy;&ocy;&chcy;&icy;&mcy; &dcy;&iecy;&rcy;&iecy;&vcy;&ocy;&mcy;.</span></p> </li> </ul> </div> </div><address>
<p>
    &copy; 2012&ndash;2024 Scott Chacon and others<br/>Licensed under the MIT License.<br/>
<a href="https://git-scm.com/docs/gitcli">https://git-scm.com/docs/gitcli</a>
</p>
</address>                </article>
            </main>

            <br>
            <br>
            <hr>

                            <ins class="adsbygoogle"
     style="display:block"
     data-ad-client="ca-pub-6424571640879890"
     data-ad-slot="3954319254"
     data-ad-format="auto"
     data-full-width-responsive="true"></ins>
<script data-cfasync="false" src="../../../cdn-cgi/scripts/5c5dd728/cloudflare-static/email-decode.min.js"></script><script>
     (adsbygoogle = window.adsbygoogle || []).push({});
</script>            
        </div>

        <!-- -->

        <div class="col-md-3">
            <br>
            <form action="-index-.html">
                <div class="input-group">
                    <input class="form-control" type="search" name="q" placeholder="Search for Git" required>
                    <button class="btn btn-primary" type="submit">
                        <i class="bi bi-search"></i>
                    </button>
                </div>
            </form>
            <br>

                            <div class="list-group list-group-flush">
                                            <a class="list-group-item list-group-item-action text-primary-emphasis px-2 text-truncate" href="gitcore-tutorial.html">
                            gitcore tutorial                        </a>
                                            <a class="list-group-item list-group-item-action text-primary-emphasis px-2 text-truncate" href="gitcredentials.html">
                            gitcredentials                        </a>
                                            <a class="list-group-item list-group-item-action text-primary-emphasis px-2 text-truncate" href="gitcvs-migration.html">
                            gitcvs migration                        </a>
                                            <a class="list-group-item list-group-item-action text-primary-emphasis px-2 text-truncate" href="gitdiffcore.html">
                            gitdiffcore                        </a>
                                            <a class="list-group-item list-group-item-action text-primary-emphasis px-2 text-truncate" href="giteveryday.html">
                            giteveryday                        </a>
                                            <a class="list-group-item list-group-item-action text-primary-emphasis px-2 text-truncate" href="gitfaq.html">
                            gitfaq                        </a>
                                            <a class="list-group-item list-group-item-action text-primary-emphasis px-2 text-truncate" href="gitformat-bundle.html">
                            gitformat bundle                        </a>
                                    </div>
            
            <br>
            <div class="my-3">
                   <ins class="adsbygoogle"
        style="display:block"
        data-ad-format="autorelaxed"
        data-ad-client="ca-pub-6424571640879890"
        data-ad-slot="7867651344"></ins>
   <script>
        (adsbygoogle = window.adsbygoogle || []).push({});
   </script>            </div>
            <br>

            
            
        </div>
    </div>
</div>    <!--/sse-->

    <footer>
        <br>
        <div class="container">
            <div class="row">
                <div class="col">
                    <hr>
                    <div class="row">
                        <div class="col-md-10">
                            <ul class="nav">
                                <li class="nav-item">
                                    <a class="nav-link ps-0" href="https://runebook.dev/">Help us Improve Translation</a>
                                </li>
                                                            </ul>
                        </div>
                        <div class="col-md-2 text-end">
                            <a href="gitcli.html#" class="fs-5" aria-label="Top">
                                <i class="bi bi-arrow-up-square-fill"></i>
                            </a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <br>
    </footer>
    <script src="../../../runebook.js"></script>
</body>

</html>